|
|
@@ -56,8 +56,10 @@ class TestAStaffUser(WebTestCase):
|
|
56
|
56
|
form['upc'] = '123456'
|
|
57
|
57
|
form['title'] = 'new product'
|
|
58
|
58
|
form['productcategory_set-0-category'] = category.id
|
|
59
|
|
- form['partner'] = self.partner.id
|
|
60
|
|
- form['partner_sku'] = '14'
|
|
|
59
|
+ form['stockrecords-0-partner'] = self.partner.id
|
|
|
60
|
+ form['stockrecords-0-partner_sku'] = '14'
|
|
|
61
|
+ form['stockrecords-0-num_in_stock'] = '555'
|
|
|
62
|
+ form['stockrecords-0-price_excl_tax'] = '13.99'
|
|
61
|
63
|
page = form.submit('action', index=0)
|
|
62
|
64
|
|
|
63
|
65
|
self.assertEquals(Product.objects.count(), 1)
|
|
|
@@ -163,8 +165,8 @@ class TestANonStaffUser(TestAStaffUser):
|
|
163
|
165
|
self.partner.users.add(self.user)
|
|
164
|
166
|
|
|
165
|
167
|
def test_can_list_her_products(self):
|
|
166
|
|
- product1 = create_product(partner_users=[self.user, ])
|
|
167
|
|
- product2 = create_product(partner="sneaky", partner_users=[])
|
|
|
168
|
+ product1 = create_product(partner="A", partner_users=[self.user, ])
|
|
|
169
|
+ product2 = create_product(partner="B", partner_users=[])
|
|
168
|
170
|
page = self.get(reverse('dashboard:catalogue-product-list'))
|
|
169
|
171
|
assert product1 in page.context['object_list']
|
|
170
|
172
|
assert product2 not in page.context['object_list']
|