Permalink
Browse files

Added test for custom_detail

  • Loading branch information...
1 parent 8e78bc0 commit 74dc614aec0bff4e975e971da2d12457bc879c60 @HonzaKral HonzaKral committed May 19, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 tests/unit_project/test_core/test_custom_urls.py
@@ -13,7 +13,7 @@ def second_view(request, bits, context):
return request, bits, context
def custom_view(request, context):
- return request, context
+ return u"OK"
class CustomUrlDispatcherTestCase(UnitTestCase):
def setUp(self):
@@ -66,6 +66,10 @@ class TestViewCalling(CustomUrlDispatcherTestCase):
def test_nonexisting_view_raises_404(self):
self.assert_raises(Http404, self.dispatcher.call_view, request=object(), bits=['start'], context=self.context)
+ def test_call_custom_detail_simple_success(self):
+ self.dispatcher.register_custom_detail(self.__class__, custom_view)
+ self.assert_equals(u"OK", self.dispatcher.call_custom_detail(request=object(), context=self.context))
+
def test_call_view_simple_success(self):
self.dispatcher.register('start', view)
self.assert_equals(u"OK", self.dispatcher.call_view(request=object(), bits=['start'], context=self.context))

0 comments on commit 74dc614

Please sign in to comment.