Conversation
tests/test_events.py
Outdated
| @@ -1,4 +1,4 @@ | |||
| from unittest import skip | |||
| # from unittest import skip | |||
There was a problem hiding this comment.
Delete this line (and the following, blank, line). Generally don't leave commented-out code in a file, unless it's in a transitional state.
tests/test_events.py
Outdated
| ) | ||
| self.assertEqual(response.status_code, 200) | ||
| # TODO: test that the event has a new value | ||
| self.assertIn(b'new title', response.data) |
There was a problem hiding this comment.
Something like self.assertEqual(flask.json.loads(response.data)['title'], 'new title') will test the specific field. This will also be easier to read the intent of the test from.
tests/test_events.py
Outdated
| content_type='application/json' | ||
| ) | ||
| self.assertEqual(response.status_code, 200) | ||
| self.assertIn(b'new title', response.data) |
There was a problem hiding this comment.
See comment above about testing for the actual title property .
tests/test_events.py
Outdated
| ) | ||
| self.assertEqual(response.status_code, 401) | ||
|
|
||
| with self.subTest("succeeds when required fields are present"): |
There was a problem hiding this comment.
This subtest description is misleading. It actually tests whether a user inside the local network can delete an event.
osteele
left a comment
There was a problem hiding this comment.
Looks good! Please address the comments, and then I'll merge it.
|
There's one more comment, around |
Closes #103.
There's one sub-test left to implement; I wasn't sure what invalid data would look like for delete.