Added setUp() method to FlatpageModelTests.
This commit is contained in:
parent
41be85862d
commit
bd8deeccd5
|
@ -5,11 +5,12 @@ from django.test.utils import override_script_prefix
|
||||||
|
|
||||||
class FlatpageModelTests(SimpleTestCase):
|
class FlatpageModelTests(SimpleTestCase):
|
||||||
|
|
||||||
def test_get_absolute_url_urlencodes(self):
|
def setUp(self):
|
||||||
pf = FlatPage(title="Café!", url='/café/')
|
self.page = FlatPage(title='Café!', url='/café/')
|
||||||
self.assertEqual(pf.get_absolute_url(), '/caf%C3%A9/')
|
|
||||||
|
|
||||||
@override_script_prefix('/beverages/')
|
def test_get_absolute_url_urlencodes(self):
|
||||||
|
self.assertEqual(self.page.get_absolute_url(), '/caf%C3%A9/')
|
||||||
|
|
||||||
|
@override_script_prefix('/prefix/')
|
||||||
def test_get_absolute_url_honors_script_prefix(self):
|
def test_get_absolute_url_honors_script_prefix(self):
|
||||||
pf = FlatPage(title="Tea!", url='/tea/')
|
self.assertEqual(self.page.get_absolute_url(), '/prefix/caf%C3%A9/')
|
||||||
self.assertEqual(pf.get_absolute_url(), '/beverages/tea/')
|
|
||||||
|
|
Loading…
Reference in New Issue