-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests and documentation for 'get_object_id'
Fix #178
- Loading branch information
1 parent
ec26bec
commit 41edd40
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
"""Root Object Id Testing | ||
Tests for 'Object Found' (200) and 'Object Not Found'(404) | ||
""" | ||
|
||
from django.test import TestCase | ||
from rest_framework.test import APIClient | ||
|
||
class ObjectIdRootObjectIdTest(TestCase): | ||
fixtures = ['tests/fixtures/test_data'] | ||
|
||
def test_seccussfull_retrieval(self): | ||
"""200: Object returned. | ||
""" | ||
|
||
client = APIClient() | ||
response = self.client.get('/BCO_000001') | ||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_object_not_found(self): | ||
"""404: Object not found. | ||
""" | ||
|
||
response = self.client.get('/BCO_001000') | ||
self.assertEqual(response.status_code, 404) |