Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #11288: added some tests for the handling of number-lik…

…e variables in templates.

Thanks, Stephen Kelly.

Backport of [13460] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13462 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c0040b41514d37ef7d31cda9bee8718a64828390 1 parent 38813c4
Jacob Kaplan-Moss authored August 03, 2010

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  tests/regressiontests/templates/tests.py
11  tests/regressiontests/templates/tests.py
@@ -506,6 +506,17 @@ def get_template_tests(self):
506 506
             'basic-syntax28': ("{{ a.b }}", {'a': SilentGetItemClass()}, ('', 'INVALID')),
507 507
             'basic-syntax29': ("{{ a.b }}", {'a': SilentAttrClass()}, ('', 'INVALID')),
508 508
 
  509
+            # Something that starts like a number but has an extra lookup works as a lookup. 
  510
+            'basic-syntax30': ("{{ 1.2.3 }}", {"1": {"2": {"3": "d"}}}, "d"), 
  511
+            'basic-syntax31': ("{{ 1.2.3 }}", {"1": {"2": ("a", "b", "c", "d")}}, "d"), 
  512
+            'basic-syntax32': ("{{ 1.2.3 }}", {"1": (("x", "x", "x", "x"), ("y", "y", "y", "y"), ("a", "b", "c", "d"))}, "d"), 
  513
+            'basic-syntax33': ("{{ 1.2.3 }}", {"1": ("xxxx", "yyyy", "abcd")}, "d"), 
  514
+            'basic-syntax34': ("{{ 1.2.3 }}", {"1": ({"x": "x"}, {"y": "y"}, {"z": "z", "3": "d"})}, "d"), 
  515
+            
  516
+            # Numbers are numbers even if their digits are in the context. 
  517
+            'basic-syntax35': ("{{ 1 }}", {"1": "abc"}, "1"), 
  518
+            'basic-syntax36': ("{{ 1.2 }}", {"1": "abc"}, "1.2"), 
  519
+
509 520
             # List-index syntax allows a template to access a certain item of a subscriptable object.
510 521
             'list-index01': ("{{ var.1 }}", {"var": ["first item", "second item"]}, "second item"),
511 522
 

0 notes on commit c0040b4

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