Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 384e88f162ae80e820522335651cc625247266dd @j4mie committed Jun 30, 2011
@@ -0,0 +1 @@
+*.py[co]
@@ -0,0 +1,2 @@
+urlobject==0.5.1
+django-templatetag-sugar==0.1
No changes.
No changes.
No changes.
@@ -0,0 +1,9 @@
+from django import template
+from templatetag_sugar.register import tag
+from templatetag_sugar.parser import Name, Variable, Constant, Optional, Model
+
+register = template.Library()
+
+@tag(register, [Variable()])
+def spurl(context, base_url):
+ return base_url
@@ -0,0 +1,15 @@
+# bootstrap django
+from django.conf import settings
+settings.configure()#INSTALLED_APPS=('spurl',))
+
+from django.template import Template, Context, loader
+
+loader.add_to_builtins('spurl.templatetags.spurl')
+
+def render(template_string, dictionary=None):
+ return Template(template_string).render(Context(dictionary))
+
+def test_passthrough():
+ template = """{% spurl "http://www.google.com" %}"""
+ assert render(template) == 'http://www.google.com'
+
@@ -0,0 +1,2 @@
+django==1.3
+nose

0 comments on commit 384e88f

Please sign in to comment.