ecommerce.products.tests package¶
Submodules¶
ecommerce.products.tests.factories module¶
- class ecommerce.products.tests.factories.AttributeFactory(**kwargs)¶
Bases:
DjangoModelFactory
- created_by = <factory.declarations.SubFactory object>¶
- description = <factory.faker.Faker object>¶
- is_active = True¶
- name = <factory.declarations.Sequence object>¶
- slug = <factory.declarations.Sequence object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- class ecommerce.products.tests.factories.BrandFactory(**kwargs)¶
Bases:
DjangoModelFactory
- created_by = <factory.declarations.SubFactory object>¶
- description = <factory.faker.Faker object>¶
- is_active = True¶
- name = <factory.declarations.Sequence object>¶
- slug = <factory.declarations.Sequence object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- class ecommerce.products.tests.factories.CategoryFactory(**kwargs)¶
Bases:
DjangoModelFactory
- created_by = <factory.declarations.SubFactory object>¶
- depth = 1¶
- is_active = True¶
- lft = 1¶
- name = <factory.declarations.Sequence object>¶
- rgt = 2¶
- slug = <factory.declarations.Sequence object>¶
- tree_id = <factory.faker.Faker object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- class ecommerce.products.tests.factories.ProductAttributeFactory(**kwargs)¶
Bases:
DjangoModelFactory
- attribute = <factory.declarations.SubFactory object>¶
- created_by = <factory.declarations.SubFactory object>¶
- product_line = <factory.declarations.SubFactory object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- value = <factory.faker.Faker object>¶
- class ecommerce.products.tests.factories.ProductFactory(**kwargs)¶
Bases:
DjangoModelFactory
- brand = <factory.declarations.SubFactory object>¶
- category = <factory.declarations.SubFactory object>¶
- created_by = <SelfAttribute('owner', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- description = <factory.faker.Faker object>¶
- images = <ecommerce.utils.factories.RelatedFactoryVariableList object>¶
- is_active = True¶
- name = <factory.declarations.Sequence object>¶
- owner = <factory.declarations.SubFactory object>¶
- product_lines = <ecommerce.utils.factories.RelatedFactoryVariableList object>¶
- slug = <factory.declarations.Sequence object>¶
- updated_by = <SelfAttribute('owner', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- class ecommerce.products.tests.factories.ProductImageFactory(**kwargs)¶
Bases:
DjangoModelFactory
- alt_text = <factory.faker.Faker object>¶
- created_by = <factory.declarations.SubFactory object>¶
- image = <factory.django.ImageField object>¶
- product = <factory.declarations.SubFactory object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
- class ecommerce.products.tests.factories.ProductLineFactory(**kwargs)¶
Bases:
DjangoModelFactory
- attributes = <ecommerce.utils.factories.RelatedFactoryVariableList object>¶
- created_by = <factory.declarations.SubFactory object>¶
- is_active = True¶
- price = <factory.faker.Faker object>¶
- product = <factory.declarations.SubFactory object>¶
- sku = <factory.faker.Faker object>¶
- stock_quantity = <factory.faker.Faker object>¶
- updated_by = <SelfAttribute('created_by', default=<class 'factory.declarations._UNSPECIFIED'>)>¶
ecommerce.products.tests.test_admin module¶
- class ecommerce.products.tests.test_admin.TestAttributeAdmin¶
Bases:
object
Test cases for Attribute Administration Pages and Actions.
- test_add(admin_client: Client)¶
Test that the add page is accessible.
- test_changelist(admin_client: Client)¶
Test that the changelist page is accessible.
- test_delete(admin_client: Client, attribute: Attribute)¶
Test that the delete page is not accessible.
- test_make_active(admin_client: Client, attribute: Attribute, admin_user: User)¶
Test that the make_active action is working.
- test_make_inactive(admin_client: Client, attribute: Attribute, admin_user: User)¶
Test that the make_inactive action is working.
- test_search(admin_client: Client)¶
Test that the search is working.
- class ecommerce.products.tests.test_admin.TestBrandAdmin¶
Bases:
object
Test cases for Brand Administration Pages and Actions.
- test_add(admin_client: Client, brand_factory: BrandFactory, admin_user: User)¶
Test that the add page is accessible and the add action is working.
- test_changelist(admin_client: Client)¶
Test that the changelist page is accessible.
- test_edit(admin_client: Client, brand: Brand, admin_user: User)¶
Test that the edit page is accessible and the edit action is working.
- test_make_active(admin_client: Client, brand: Brand, admin_user: User)¶
Test that the make_active action is working.
- test_make_inactive(admin_client: Client, brand: Brand, admin_user: User)¶
Test that the make_inactive action is working.
- test_search(admin_client: Client)¶
Test that the search is working.
- class ecommerce.products.tests.test_admin.TestCategoryAdmin¶
Bases:
object
Test cases for Category Administration Pages and Actions.
- test_add(admin_client: Client, category_factory: CategoryFactory, category: Category, admin_user: User)¶
Test that the add page is accessible and the category is created.
- test_changelist(admin_client: Client)¶
Test that the changelist page is accessible.
- test_edit(admin_client: Client, category: Category, admin_user: User)¶
Test that the edit page is accessible and the category is updated.
- test_make_active(admin_client: Client, category: Category, admin_user: User)¶
Test that the make_active action is working.
- test_make_inactive(admin_client: Client, category: Category, admin_user: User)¶
Test that the make_inactive action is working.
- test_search(admin_client: Client)¶
Test that the search is working.
- class ecommerce.products.tests.test_admin.TestProductAdmin¶
Bases:
object
Test cases for Product Administration Pages and Actions.
- test_add(admin_client: Client, product_factory: ProductFactory, brand: Brand, category: Category, admin_user: User)¶
Test that the add page is accessible and the product is created.
- test_changelist(admin_client: Client)¶
Test that the changelist page is accessible.
- test_delete(admin_client: Client, product: Product)¶
Test that the delete page is accessible and the product is deleted.
- test_edit(admin_client: Client, product: Product, admin_user: User)¶
Test that the edit page is accessible and the product is updated.
- test_make_active(admin_client: Client, product: Product, admin_user: User)¶
Test that the make_active action is working.
- test_make_inactive(admin_client: Client, product: Product, admin_user: User)¶
Test that the make_inactive action is working.
- test_search(admin_client: Client)¶
Test that the search is working.
ecommerce.products.tests.test_forms module¶
ecommerce.products.tests.test_models module¶
- class ecommerce.products.tests.test_models.TestProductAttributeModels¶
Bases:
object
- test_product_attribute_str(product_attribute: ProductAttribute)¶
- class ecommerce.products.tests.test_models.TestProductImageModels¶
Bases:
object
- test_product_image_str(product_image: ProductImage)¶
- class ecommerce.products.tests.test_models.TestProductLineModels¶
Bases:
object
- test_product_line_str(product_line: ProductLine)¶