Revision 2aba7764 snf-django-lib/snf_django/utils/testing.py
b/snf-django-lib/snf_django/utils/testing.py | ||
---|---|---|
268 | 268 |
self.assertFault(response, 409, "conflict") |
269 | 269 |
|
270 | 270 |
def assertMethodNotAllowed(self, response): |
271 |
self.assertFault(response, 400, 'badRequest') |
|
271 |
self.assertFault(response, 405, 'notAllowed') |
|
272 |
self.assertTrue('Allow' in response) |
|
272 | 273 |
try: |
273 | 274 |
error = json.loads(response.content) |
274 | 275 |
except ValueError: |
275 | 276 |
self.assertTrue(False) |
276 |
self.assertEqual(error['badRequest']['message'], 'Method not allowed')
|
|
277 |
self.assertEqual(error['notAllowed']['message'], 'Method not allowed')
|
|
277 | 278 |
|
278 | 279 |
|
279 | 280 |
# Imitate unittest assertions new in Python 2.7 |
Also available in: Unified diff