diff --git a/djangoql/admin.py b/djangoql/admin.py
index 8838e65..c447fa7 100644
--- a/djangoql/admin.py
+++ b/djangoql/admin.py
@@ -112,6 +112,9 @@ def djangoql_error_message(self, exception):
msg = text_type(exception)
return render_to_string('djangoql/error_message.html', context={
'error_message': msg,
+ 'djangoql_syntax_help_url': reverse(
+ '%s:djangoql_syntax_help' % self.admin_site.name,
+ ),
})
@property
diff --git a/djangoql/templates/djangoql/error_message.html b/djangoql/templates/djangoql/error_message.html
index 7395e81..efb0f3b 100644
--- a/djangoql/templates/djangoql/error_message.html
+++ b/djangoql/templates/djangoql/error_message.html
@@ -1,6 +1,6 @@
diff --git a/test_project/core/tests/test_admin.py b/test_project/core/tests/test_admin.py
index a3af7dd..eb7b1fd 100644
--- a/test_project/core/tests/test_admin.py
+++ b/test_project/core/tests/test_admin.py
@@ -46,14 +46,17 @@ def test_introspection_suggestion_api_url(self):
)
def test_djangoql_syntax_help(self):
- url = reverse('admin:djangoql_syntax_help')
- # unauthorized request should be redirected
- response = self.client.get(url)
- self.assertEqual(302, response.status_code)
- self.assertTrue(self.client.login(**self.credentials))
- # authorized request should be served
- response = self.client.get(url)
- self.assertEqual(200, response.status_code)
+ for app in ['admin', 'zaibatsu']:
+ url = reverse('%s:djangoql_syntax_help' % app)
+ with self.subTest(app=app):
+ # unauthorized request should be redirected
+ response = self.client.get(url)
+ self.assertEqual(302, response.status_code)
+ self.assertTrue(self.client.login(**self.credentials))
+ # authorized request should be served
+ response = self.client.get(url)
+ self.assertEqual(200, response.status_code)
+ self.client.logout()
def test_suggestions(self):
url = reverse('admin:core_book_djangoql_suggestions')