Skip to content

Commit 724c19c

Browse files
author
Matthew Fisher
committed
test(controller): ensure config owner is requesting user
1 parent 6a2be87 commit 724c19c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

controller/api/tests/test_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ def test_admin_can_create_config_on_other_apps(self):
187187
HTTP_AUTHORIZATION='token {}'.format(self.token))
188188
self.assertEqual(response.status_code, 201)
189189
self.assertIn('PORT', response.data['values'])
190+
return response
190191

191192
@mock.patch('requests.post', mock_import_repository_task)
192193
def test_limit_memory(self):
@@ -423,3 +424,11 @@ def test_tags(self):
423424
self.assertEqual(response.status_code, 405)
424425
response = self.client.delete(url, HTTP_AUTHORIZATION='token {}'.format(self.token))
425426
self.assertEqual(response.status_code, 405)
427+
428+
def test_config_owner_is_requesting_user(self):
429+
"""
430+
Ensure that setting the config value is owned by the requesting user
431+
See https://github.com/deis/deis/issues/2650
432+
"""
433+
response = self.test_admin_can_create_config_on_other_apps()
434+
self.assertEqual(response.data['owner'], self.user.username)

0 commit comments

Comments
 (0)