Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved custom unit-test templatetag library into the unit test module …

…itself, to fix errors when running the test module directly.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 63cf85b64d3cb84e151f1994a6116c17deaefb33 1 parent 4e70068
@adrianholovaty adrianholovaty authored
View
25 tests/othertests/templates.py
@@ -8,7 +8,30 @@
from django.utils.translation import activate, deactivate, install
import traceback
-# Helper objects for template tests
+#################################
+# Custom template tag for tests #
+#################################
+
+register = template.Library()
+
+class EchoNode(template.Node):
+ def __init__(self, contents):
+ self.contents = contents
+
+ def render(self, context):
+ return " ".join(self.contents)
+
+def do_echo(parser, token):
+ return EchoNode(token.contents.split()[1:])
+
+register.tag("echo", do_echo)
+
+template.libraries['django.templatetags.testtags'] = register
+
+#####################################
+# Helper objects for template tests #
+#####################################
+
class SomeClass:
def __init__(self):
self.otherclass = OtherClass()
View
0  tests/testapp/templatetags/__init__.py
No changes.
View
17 tests/testapp/templatetags/testtags.py
@@ -1,17 +0,0 @@
-# Custom tag library used in conjunction with template tests
-
-from django.core import template
-
-register = template.Library()
-
-class EchoNode(template.Node):
- def __init__(self, contents):
- self.contents = contents
-
- def render(self, context):
- return " ".join(self.contents)
-
-def do_echo(parser, token):
- return EchoNode(token.contents.split()[1:])
-
-register.tag("echo", do_echo)

0 comments on commit 63cf85b

Please sign in to comment.
Something went wrong with that request. Please try again.