def test_decorator(self): r = Router() @r.register(r'^test/$') def func(request): pass self.assertEqual(r.resolve('test/'), (func, (), {}))
def test_register(self): r = Router() def func(request): pass r.register(r'^test/$', func) self.assertEqual(r.resolve('test/'), (func, (), {}))