Loading AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ answer newbie questions, and generally made Django that much better: Christian Oudard <christian.oudard@gmail.com> oggie rob <oz.robharvey@gmail.com> oggy <ognjen.maric@gmail.com> Jens Page Jay Parlar <parlar@gmail.com> Carlos Eduardo de Paula <carlosedp@gmail.com> John Paulett <john@paulett.org> Loading django/contrib/flatpages/fixtures/example_site.json 0 → 100644 +11 −0 Original line number Diff line number Diff line [ { "pk": 1, "model": "sites.site", "fields": { "domain": "example.com", "name": "example.com" } } ] django/contrib/flatpages/tests/csrf.py +2 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,10 @@ from django.test.utils import override_settings TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): Loading django/contrib/flatpages/tests/forms.py +4 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,10 @@ from django.test import TestCase from django.test.utils import override_settings from django.utils import translation @override_settings(SITE_ID=1) class FlatpageAdminFormTests(TestCase): fixtures = ['example_site'] def setUp(self): self.form_data = { 'title': "A test page", Loading Loading @@ -89,5 +92,5 @@ class FlatpageAdminFormTests(TestCase): self.assertEqual( f.errors, {'sites': [u'This field is required.']}) {'sites': [translation.ugettext(u'This field is required.')]}) django/contrib/flatpages/tests/middleware.py +7 −5 Original line number Diff line number Diff line Loading @@ -19,9 +19,10 @@ from django.test.utils import override_settings TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageMiddlewareTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def test_view_flatpage(self): Loading Loading @@ -75,7 +76,7 @@ class FlatpageMiddlewareTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/some.very_special~chars-here/') self.assertEqual(response.status_code, 200) Loading @@ -96,9 +97,10 @@ class FlatpageMiddlewareTests(TestCase): TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageMiddlewareAppendSlashTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def test_redirect_view_flatpage(self): Loading Loading @@ -130,7 +132,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/some.very_special~chars-here') self.assertRedirects(response, '/some.very_special~chars-here/', status_code=301) Loading @@ -144,7 +146,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/') self.assertEqual(response.status_code, 200) Loading Loading
AUTHORS +1 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ answer newbie questions, and generally made Django that much better: Christian Oudard <christian.oudard@gmail.com> oggie rob <oz.robharvey@gmail.com> oggy <ognjen.maric@gmail.com> Jens Page Jay Parlar <parlar@gmail.com> Carlos Eduardo de Paula <carlosedp@gmail.com> John Paulett <john@paulett.org> Loading
django/contrib/flatpages/fixtures/example_site.json 0 → 100644 +11 −0 Original line number Diff line number Diff line [ { "pk": 1, "model": "sites.site", "fields": { "domain": "example.com", "name": "example.com" } } ]
django/contrib/flatpages/tests/csrf.py +2 −1 Original line number Diff line number Diff line Loading @@ -18,9 +18,10 @@ from django.test.utils import override_settings TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): Loading
django/contrib/flatpages/tests/forms.py +4 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,10 @@ from django.test import TestCase from django.test.utils import override_settings from django.utils import translation @override_settings(SITE_ID=1) class FlatpageAdminFormTests(TestCase): fixtures = ['example_site'] def setUp(self): self.form_data = { 'title': "A test page", Loading Loading @@ -89,5 +92,5 @@ class FlatpageAdminFormTests(TestCase): self.assertEqual( f.errors, {'sites': [u'This field is required.']}) {'sites': [translation.ugettext(u'This field is required.')]})
django/contrib/flatpages/tests/middleware.py +7 −5 Original line number Diff line number Diff line Loading @@ -19,9 +19,10 @@ from django.test.utils import override_settings TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageMiddlewareTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def test_view_flatpage(self): Loading Loading @@ -75,7 +76,7 @@ class FlatpageMiddlewareTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/some.very_special~chars-here/') self.assertEqual(response.status_code, 200) Loading @@ -96,9 +97,10 @@ class FlatpageMiddlewareTests(TestCase): TEMPLATE_DIRS=( os.path.join(os.path.dirname(__file__), 'templates'), ), SITE_ID=1, ) class FlatpageMiddlewareAppendSlashTests(TestCase): fixtures = ['sample_flatpages'] fixtures = ['sample_flatpages', 'example_site'] urls = 'django.contrib.flatpages.tests.urls' def test_redirect_view_flatpage(self): Loading Loading @@ -130,7 +132,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/some.very_special~chars-here') self.assertRedirects(response, '/some.very_special~chars-here/', status_code=301) Loading @@ -144,7 +146,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase): enable_comments=False, registration_required=False, ) fp.sites.add(1) fp.sites.add(settings.SITE_ID) response = self.client.get('/') self.assertEqual(response.status_code, 200) Loading