Mark fields as required on globalmessages API so that they are
properly checked when the request comes in
This commit is contained in:
parent
f05b6d8c52
commit
d4ef594c13
2 changed files with 6 additions and 1 deletions
|
@ -58,6 +58,11 @@ class GlobalUserMessages(ApiResource):
|
|||
'message': {
|
||||
'type': 'object',
|
||||
'description': 'A single message',
|
||||
'required': [
|
||||
'content',
|
||||
'media_type',
|
||||
'severity',
|
||||
],
|
||||
'properties': {
|
||||
'content': {
|
||||
'type': 'string',
|
||||
|
|
|
@ -4318,7 +4318,7 @@ class TestSuperUserMessages(ApiTestCase):
|
|||
def setUp(self):
|
||||
ApiTestCase.setUp(self)
|
||||
self._set_url(GlobalUserMessages)
|
||||
self.message = {'message': {'content': '', 'severity': 'info', 'media_type': 'text/plain'}}
|
||||
self.message = {'message': {'content': 'msg', 'severity': 'info', 'media_type': 'text/plain'}}
|
||||
|
||||
def test_post_anonymous(self):
|
||||
self._run_test('POST', 401, None, None)
|
||||
|
|
Reference in a new issue