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')
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'