Commit 08f46ac0 authored by Daniel Schreiber's avatar Daniel Schreiber

add test for conflicting attributes via REST API

parent 0fd19c3d
Pipeline #27527 passed with stage
in 26 seconds
......@@ -132,3 +132,24 @@ class AttributeUpdateTest(APITestCase):
self.assertEqual(3, Attribute.objects.get().vec_sp)
self.assertEqual(0, Attribute.objects.get().vec_idp)
self.assertEqual(2, QueueJob.objects.count())
def test_attribute_update_rejected(self):
url = reverse('resource_attributes', args=[self.res.uuid])
user = TokenAuthUser.objects.get(username='b_sync')
self.client.force_authenticate(user=user, token=user.token())
data = [
{
"name": "Quota",
"value": 23,
"vec_idp": 3,
"vec_sp": 0,
},
]
self.assertEqual(0, QueueJob.objects.count())
response = self.client.put(url, data=data, format='json')
self.assertEqual("rejected", response.data[0]["Quota"]["status"])
self.assertEqual(50, self.attrib.value)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment