igorsimb / mp-monitor

Django app for scraping Wildberries
1 stars 0 forks source link

feature(models): add Status to Tenant model #72

Closed igorsimb closed 6 months ago

igorsimb commented 6 months ago

Fixes #67, #58

Summary by CodeRabbit

coderabbitai[bot] commented 6 months ago

Walkthrough

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.

Changes

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.