summaryrefslogtreecommitdiff
path: root/tests/regressiontests/syndication
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-20 06:35:53 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-20 06:35:53 +0000
commit6417f5247b98d5457d5b62c313cd8e1edeaa5e63 (patch)
tree1e6dbc314b065e577b1d36d3756803a4f83edab4 /tests/regressiontests/syndication
parent649cdf907d5d23290caf3cc7e34426c39dfa4159 (diff)
Merged the tests and documentation from #4720 to support the changes in [7295].
Thanks, Andy Gayton. Fixed #4720. Refs #5855. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/syndication')
-rw-r--r--tests/regressiontests/syndication/__init__.py0
-rw-r--r--tests/regressiontests/syndication/tests.py14
-rw-r--r--tests/regressiontests/syndication/urls.py18
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/regressiontests/syndication/__init__.py b/tests/regressiontests/syndication/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/syndication/__init__.py
diff --git a/tests/regressiontests/syndication/tests.py b/tests/regressiontests/syndication/tests.py
new file mode 100644
index 0000000000..6a9dd643d7
--- /dev/null
+++ b/tests/regressiontests/syndication/tests.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+
+from django.test import TestCase
+from django.test.client import Client
+
+class SyndicationFeedTest(TestCase):
+ def test_complex_base_url(self):
+ """
+ Tests that that the base url for a complex feed doesn't raise a 500
+ exception.
+ """
+ c = Client()
+ response = c.get('/syndication/feeds/complex/')
+ self.assertEquals(response.status_code, 404)
diff --git a/tests/regressiontests/syndication/urls.py b/tests/regressiontests/syndication/urls.py
new file mode 100644
index 0000000000..24644ffd53
--- /dev/null
+++ b/tests/regressiontests/syndication/urls.py
@@ -0,0 +1,18 @@
+from django.conf.urls.defaults import patterns
+from django.core.exceptions import ObjectDoesNotExist
+from django.contrib.syndication import feeds
+
+
+class ComplexFeed(feeds.Feed):
+ def get_object(self, bits):
+ if len(bits) != 1:
+ raise ObjectDoesNotExist
+ return None
+
+
+urlpatterns = patterns('',
+ (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {
+ 'feed_dict': dict(
+ complex = ComplexFeed,
+ )}),
+)