예제 #1
0
 def test_reuse_api_update(self):
     '''It should update a reuse from the API'''
     self.login()
     reuse = ReuseFactory(owner=self.user)
     data = reuse.to_dict()
     data['description'] = 'new description'
     response = self.put(url_for('api.reuse', reuse=reuse), data)
     self.assert200(response)
     self.assertEqual(Reuse.objects.count(), 1)
     self.assertEqual(Reuse.objects.first().description, 'new description')
예제 #2
0
 def test_reuse_api_update(self):
     '''It should update a reuse from the API'''
     self.login()
     reuse = ReuseFactory(owner=self.user)
     data = reuse.to_dict()
     data['description'] = 'new description'
     response = self.put(url_for('api.reuse', reuse=reuse), data)
     self.assert200(response)
     self.assertEqual(Reuse.objects.count(), 1)
     self.assertEqual(Reuse.objects.first().description, 'new description')
예제 #3
0
 def test_reuse_api_update(self, api):
     '''It should update a reuse from the API'''
     user = api.login()
     reuse = ReuseFactory(owner=user)
     data = reuse.to_dict()
     data['description'] = 'new description'
     response = api.put(url_for('api.reuse', reuse=reuse), data)
     assert200(response)
     assert Reuse.objects.count() == 1
     assert Reuse.objects.first().description == 'new description'