def set_up_mock_data(cls, product_qty=5, product_item_qty=3): cls.catalog = CatalogMockData().create() cls.products = ProductMockData(cls.catalog, product_qty).create_list() cls.product_items = [ ProductItemsMockData(cls.products[i], product_item_qty).create_list() for i in range(product_qty) ]
def setUpTestData(cls): cls.product_count = 42 cls.catalog = CatalogMockData().create() cls.products = ProductMockData(cls.catalog, cls.product_count).create_list() cls.url = cls.catalog.get_absolute_url() cls.template_name = CatalogView.template_name
def setUp(self): super().setUp() catalog = CatalogMockData().create() self.product = ProductMockData(catalog).create()
def setUpTestData(cls): cls.catalog = CatalogMockData().create() cls.product = ProductMockData(cls.catalog).create()
def setUpTestData(cls): cls.catalog = CatalogMockData().create() cls.product = ProductMockData(cls.catalog).create() cls.url = cls.product.get_absolute_url() cls.template_name = ProductDetail.template_name