Closed igorsimb closed 6 months ago
The recent updates focus on enhancing the Tenant
and CustomUser
models within a Django application. Key modifications include the introduction of a status
field in the Tenant
model with predefined choices and indexing for improved query performance. The CustomUser
model now references the Tenant
model, with added indexing for the tenant
field to optimize database operations. Additionally, the creation of a Tenant
instance is automated for new CustomUser
entries without a specified tenant. Comprehensive testing ensures these changes align with the objectives for database efficiency and model functionality.
Files | Change Summary |
---|---|
accounts/migrations/... , main/migrations/... |
Introduced migrations for altering CustomUser and Tenant models, including new fields and indexes. |
accounts/models.py , main/models.py |
Modified CustomUser and Tenant models to include new fields, indexes, and model options. |
tests/accounts/... , tests/main/... |
Updated and added tests for CustomUser and Tenant functionalities, including new fields and model interactions. Adjusted testing setup by removing pytest decorators and introducing a new fixture. |
tests/factories.py |
Introduced TenantFactory and UserFactory for creating model instances in tests. |
Fixes #67, #58
Summary by CodeRabbit
TenantFactory
andUserFactory
for streamlined creation ofTenant
andCustomUser
instances in tests.CustomUser
model to include arelated_name
attribute for thetenant
field, ensuring clearer relationships and queries.CustomUser
andTenant
models.pytest
decorators and adjusting test markers.