Russell Keith-Magee wrote:
> On 12/8/06, Matias Hermarud Fjeld <[EMAIL PROTECTED]> wrote:
>> I've submitted a patch on ticket #914. The patch changes the behavior of
>> the include_admin_script-templatetag. Should this have a regression test
>> as well? If so, in what file should i put the test?
> 
> Unless there is a _really_ good reason to not have a regression test,
> there should be one.
> 
> Having a quick look at the ticket, the test should probably be in the
> regressiontests section (rather than model tests). You might be able
> to fit it into the existing templates test, but you could also make a
> good argument for a new 'templatetags' regression test.

I've made a stab at writing a test for this, attached. The problem with
the approach I have used is that the '{% load admin_modify %}' stanza
fails because the django.contrib.admin is not in INSTALLED_APPS. How
should I go about to solve this?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 4193)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -630,6 +630,14 @@
             # Compare to a given parameter
             'timeuntil04' : ('{{ a|timeuntil:b }}', {'a':NOW - timedelta(days=1), 'b':NOW - timedelta(days=2)}, '1 day'),
             'timeuntil05' : ('{{ a|timeuntil:b }}', {'a':NOW - timedelta(days=2), 'b':NOW - timedelta(days=2, minutes=1)}, '1 minute'),
+
+            ### ADMIN TEMPLATETAGS #############################################
+
+            # include_admin_script
+            'include_admin_script01' : ('{% load admin_modify %}{% include_admin_script js/calendar.js %}', {}, '<script type="text/javascript" src="/media/admin/js/calendar.js">'),
+            'include_admin_script02' : ('{% load admin_modify %}{% include_admin_script /js/calendar.js %}', {}, '<script type="text/javascript" src="/js/calendar.js">'),
+            'include_admin_script02' : ('{% load admin_modify %}{% include_admin_script http://media.example.org/js/calendar.js %}', {}, '<script type="text/javascript" src="http://media.example.org/js/calendar.js";>'),
+
         }
 
         # Register our custom template loader.

Reply via email to