1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """
17 Unit tests for pytils' templatetags for Django web framework
18 """
19
20 __id__ = __revision__ = "$Id: __init__.py 76 2007-02-27 15:38:53Z the.pythy $"
21 __url__ = "$URL: https://pythy.googlecode.com/svn/trunk/pytils/pytils/test/templatetags/__init__.py $"
22 __all__ = ["test_numeral", "test_dt", "test_translit"]
23
24 import unittest
25
27 """Return TestSuite for all unit-test of PyTils' templatetags"""
28 suite = unittest.TestSuite()
29 for module_name in __all__:
30 imported_module = __import__("pytils.test.templatetags."+module_name,
31 globals(),
32 locals(),
33 ["pytils.test.templatetags"])
34
35 getter = getattr(imported_module, 'get_suite', False)
36 if getter:
37 suite.addTest(getter())
38
39 loader = unittest.defaultTestLoader
40 suite.addTest(loader.loadTestsFromModule(imported_module))
41
42 return suite
43
44 -def run(verbosity=1):
45 """Run all unit-test of PyTils' templatetags"""
46 suite = get_suite()
47 unittest.TextTestRunner(verbosity=verbosity).run(suite)
48
49 if __name__ == '__main__':
50 run(2)
51