Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Aug 21, 2018
1 parent b311d5f commit c7f6cfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions casepro/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class APITest(BaseCasesTest):
def setUp(self):
super(APITest, self).setUp()
super().setUp()

self.ann = self.create_contact(
self.unicef, "C-001", "Ann", fields={"age": "34"}, groups=[self.females, self.reporters]
Expand Down Expand Up @@ -39,9 +39,18 @@ def test_authentication(self):
response = self.url_get("unicef", url)
self.assertEqual(response.status_code, 200)

def test_actions(self):
self.maxDiff = None
def test_docs(self):
url = reverse("api.root")

response = self.url_get("unicef", url + "?format=api")
self.assertContains(response, "Login to see your access token", status_code=403)

self.login(self.admin)

response = self.url_get("unicef", url + "?format=api")
self.assertContains(response, self.admin.auth_token)

def test_actions(self):
msg1 = self.create_message(self.unicef, 101, self.ann, "Hello", [self.aids])
msg2 = self.create_message(self.unicef, 102, self.bob, "Bonjour")
case1 = self.create_case(
Expand Down
1 change: 1 addition & 0 deletions casepro/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


class Router(routers.DefaultRouter):
root_view_name = 'api.root'
APIRootView = APIRoot


Expand Down

0 comments on commit c7f6cfc

Please sign in to comment.