Skip to content

Commit

Permalink
Fix Event Modification test Data
Browse files Browse the repository at this point in the history
This patch fixes the data used for testing the event modification API
which was no proper JSON before, causing all failure tests to fail with
the same error.
  • Loading branch information
lkiesow committed Mar 7, 2022
1 parent 6db6bfe commit 5d2f7e8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/test_restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,19 @@ def test_modify_event(self):
args = dict(headers=self.headers)

# With authentication but no or invalid data
for data in (None,
'{"type":"event","id":0,"attributes":{"invalid":0}}',
'{"type":"event","id":0,"attributes":\
{"status":"invalid"}}'):
args['data'] = {'data': [data]}
for data in (
None,
{
'type': 'event',
'id': 0,
'attributes': {'invalid': 0}
},
{
'type': 'event',
'id': 0,
'attributes': {'status': 'invalid'}
}):
args['data'] = json.dumps({'data': [data]})
with ui.app.test_request_context(**args):
response = ui.jsonapi.modify_event(0)
self.assertEqual(response.status_code, 400)
Expand Down

0 comments on commit 5d2f7e8

Please sign in to comment.