Skip to content

Commit

Permalink
Test search funcitonality
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanouil Konstantinidis committed Dec 18, 2015
1 parent c548ba8 commit b7d4bc3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ def test_index_view_with_endpoints(self):
# The view "OrganisationErroredView" (organisations/(?P<slug>[\w-]+)/errored/) should contain an error.
self.assertEqual(str(response.context["endpoints"][8].errors), "'test_value'")

def test_index_search_with_endpoints(self):
url = "%s?search=reset-password" % reverse("drfdocs")
print(url)
response = self.client.get(url)

self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context["endpoints"]), 2)
self.assertEqual(response.context["endpoints"][1].path, "/accounts/reset-password/confirm/")
self.assertEqual(len(response.context["endpoints"][1].fields), 3)

@override_settings(REST_FRAMEWORK_DOCS=SETTINGS_HIDE_DOCS)
def test_index_view_docs_hidden(self):
"""
Expand Down

0 comments on commit b7d4bc3

Please sign in to comment.