summaryrefslogtreecommitdiff
path: root/tests/testapp
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-08-01 19:09:07 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-08-01 19:09:07 +0000
commit440a2a97e9a8420ddf6186d4e948662bb3015e7d (patch)
treec771a75c3bf06d9f393b5e51e22d5cd6a7f11efe /tests/testapp
parent8483f0aa047d4bff51e994e06e2ecf0365749830 (diff)
Added framework for writing non-model-based tests, and added tests for cache and templates
from the old django/tests location (which has been removed). git-svn-id: http://code.djangoproject.com/svn/django/trunk@367 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/testapp')
-rw-r--r--tests/testapp/templatetags/__init__.py0
-rw-r--r--tests/testapp/templatetags/testtags.py15
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/testapp/templatetags/__init__.py b/tests/testapp/templatetags/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/testapp/templatetags/__init__.py
diff --git a/tests/testapp/templatetags/testtags.py b/tests/testapp/templatetags/testtags.py
new file mode 100644
index 0000000000..7b755043fa
--- /dev/null
+++ b/tests/testapp/templatetags/testtags.py
@@ -0,0 +1,15 @@
+# Custom tag library used in conjunction with template tests
+
+from django.core import template
+
+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:])
+
+template.register_tag("echo", do_echo) \ No newline at end of file