Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a couple of assertions to test the reversing using the curren_a…

…pp argument
  • Loading branch information...
commit d113b7e0b844bcce53b1bd2aaf78b1a98115fd03 1 parent 095f676
@GaretJax GaretJax authored
View
1  cms/test_utils/project/sampleapp/templates/sampleapp/app.html
@@ -1 +1,2 @@
{{ app }}
+{% url namespaced_app_ns:current-app %}
View
8 cms/tests/apphooks.py
@@ -209,8 +209,10 @@ def test_get_child_page_for_apphook_with_instance_namespace(self):
en_title = self.create_base_structure(NS_APP_NAME, 'en', 'instance_ns')
path = reverse('en:namespaced_app_ns:sample-settings')
- path_instance = reverse('en:instance_ns:sample-settings')
- self.assertEquals(path, path_instance)
+ path_instance1 = reverse('en:instance_ns:sample-settings')
+ path_instance2 = reverse('en:namespaced_app_ns:sample-settings', current_app='instance_ns')
+ self.assertEquals(path, path_instance1)
+ self.assertEquals(path, path_instance2)
request = self.get_request(path)
request.LANGUAGE_CODE = 'en'
@@ -236,6 +238,7 @@ def test_get_sub_page_for_apphook_with_implicit_current_app(self):
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'sampleapp/app.html')
self.assertContains(response, 'namespaced_app_ns')
+ self.assertContains(response, path)
apphook_pool.clear()
@@ -255,6 +258,7 @@ def test_get_sub_page_for_apphook_with_explicit_current_app(self):
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'sampleapp/app.html')
self.assertContains(response, 'instance_ns')
+ self.assertContains(response, path)
apphook_pool.clear()
Please sign in to comment.
Something went wrong with that request. Please try again.