summaryrefslogtreecommitdiff
path: root/tests/regressiontests/dispatch/tests/test_robustapply.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/dispatch/tests/test_robustapply.py')
-rw-r--r--tests/regressiontests/dispatch/tests/test_robustapply.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/regressiontests/dispatch/tests/test_robustapply.py b/tests/regressiontests/dispatch/tests/test_robustapply.py
new file mode 100644
index 0000000000..499450eec4
--- /dev/null
+++ b/tests/regressiontests/dispatch/tests/test_robustapply.py
@@ -0,0 +1,34 @@
+from django.dispatch.robustapply import *
+
+import unittest
+
+def noArgument():
+ pass
+
+def oneArgument(blah):
+ pass
+
+def twoArgument(blah, other):
+ pass
+
+class TestCases(unittest.TestCase):
+ def test01(self):
+ robustApply(noArgument)
+
+ def test02(self):
+ self.assertRaises(TypeError, robustApply, noArgument, "this")
+
+ def test03(self):
+ self.assertRaises(TypeError, robustApply, oneArgument)
+
+ def test04(self):
+ """Raise error on duplication of a particular argument"""
+ self.assertRaises(TypeError, robustApply, oneArgument, "this", blah = "that")
+
+def getSuite():
+ return unittest.makeSuite(TestCases,'test')
+
+
+if __name__ == "__main__":
+ unittest.main()
+