コード例 #1
0
 def test_update_an_existing_brand_should_be_done(self):
     brand = BrandFactory.create()
     data = BrandFactory.attributes()
     resp = self.post('/admin/brand/' + str(brand.uid) + '/update', data)
     brand.reload()
     expect(brand.name).to_equal(data.get('name'))
     expect(brand.image).to_include(data.get('image'))
コード例 #2
0
 def test_update_not_existing_brand_should_response_status_404(self):
     data = BrandFactory.attributes()
     resp = self.post('/admin/brand/1001/update', data)
     expect(resp.status_int).to_equal(404)
コード例 #3
0
 def test_update_an_existing_brand_should_response_status_200(self):
     brand = BrandFactory.create()
     data = BrandFactory.attributes()
     resp = self.post('/admin/brand/' + str(brand.uid) + '/update', data)
     expect(resp.status_int).to_equal(200)
コード例 #4
0
 def test_create_a_brand_should_response_correct_data(self):
     data = BrandFactory.attributes()
     resp = self.post('/admin/brand/', data)
     expect(resp).to_include(data.get('name'))
コード例 #5
0
 def test_create_a_brand_should_response_status_201(self):
     data = BrandFactory.attributes()
     resp = self.post('/admin/brand/', data)
     expect(resp.status_int).to_equal(201)
コード例 #6
0
ファイル: test_brand.py プロジェクト: phuclc/dienthoai
 def test_get_data_from_existing_brand(self):
     attr = BrandFactory.attributes()
     data = brand.create(attr)
     b = brand.get(data.uid)
     expect(b.name).to_equal(data.name)
コード例 #7
0
ファイル: test_brand.py プロジェクト: phuclc/dienthoai
 def test_create_brand_should_work(self):
     attr = BrandFactory.attributes()
     b = brand.create(attr)
     expect(b.name).to_equal(attr.get("name"))