| 513 | RouterTestModel.objects.create(uuid='a b', text='baz qux') |
| 514 | |
| 515 | def test_create(self): |
| 516 | new_note = { |
| 517 | 'uuid': 'foo', |
| 518 | 'text': 'example' |
| 519 | } |
| 520 | response = self.client.post('/example/notes/', data=new_note) |
| 521 | assert response.status_code == 201 |
| 522 | assert response['location'] == 'http://testserver/example/notes/foo/' |
| 523 | assert response.data == {"url": "http://testserver/example/notes/foo/", "uuid": "foo", "text": "example"} |
| 524 | assert RouterTestModel.objects.filter(uuid='foo').exists() |
| 525 | |
| 526 | def test_retrieve(self): |
| 527 | for url in ('/example/notes/123/', '/default/notes/123/'): |