We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's a test that will verify that the url functions have indeed been decorated:
from django.test import TestCase from django.conf.urls import url, include from functools import wraps from core.url_utils import decorated_url def spy_decorator(func): @wraps(func) def wrap(self, *args, **kwargs): return func(*args, **kwargs) wrap.__spy__ = "spied" return wrap class TestDecoratedUrl(TestCase): def test_urls_get_decorated(self): urls = [ url(r'^$', lambda r: "Huzzah!", name='test_url_resolver'), ] res = decorated_url(r'^foo/', include(urls), wrap=[spy_decorator]) self.assertEqual(res.resolve('foo/').func.__spy__, 'spied') self.assertTrue(res)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's a test that will verify that the url functions have indeed been decorated:
The text was updated successfully, but these errors were encountered: