From 2e3fdc63262c968ec89392a9fc9fb8b7aa0ce8be Mon Sep 17 00:00:00 2001
From: Jacob Kaplan-Moss <jacob@jacobian.org>
Date: Tue, 3 Aug 2010 15:34:52 +0000
Subject: [PATCH] Fixed #11288: added some tests for the handling of
 number-like variables in templates.

Thanks, Stephen Kelly.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13460 bcc190cf-cafb-0310-a4f2-bffc1f526a37
---
 tests/regressiontests/templates/tests.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 5902e8d5e7..21afb2dd6f 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -506,6 +506,17 @@ class Templates(unittest.TestCase):
             'basic-syntax28': ("{{ a.b }}", {'a': SilentGetItemClass()}, ('', 'INVALID')),
             'basic-syntax29': ("{{ a.b }}", {'a': SilentAttrClass()}, ('', 'INVALID')),
 
+            # Something that starts like a number but has an extra lookup works as a lookup. 
+            'basic-syntax30': ("{{ 1.2.3 }}", {"1": {"2": {"3": "d"}}}, "d"), 
+            'basic-syntax31': ("{{ 1.2.3 }}", {"1": {"2": ("a", "b", "c", "d")}}, "d"), 
+            'basic-syntax32': ("{{ 1.2.3 }}", {"1": (("x", "x", "x", "x"), ("y", "y", "y", "y"), ("a", "b", "c", "d"))}, "d"), 
+            'basic-syntax33': ("{{ 1.2.3 }}", {"1": ("xxxx", "yyyy", "abcd")}, "d"), 
+            'basic-syntax34': ("{{ 1.2.3 }}", {"1": ({"x": "x"}, {"y": "y"}, {"z": "z", "3": "d"})}, "d"), 
+            
+            # Numbers are numbers even if their digits are in the context. 
+            'basic-syntax35': ("{{ 1 }}", {"1": "abc"}, "1"), 
+            'basic-syntax36': ("{{ 1.2 }}", {"1": "abc"}, "1.2"), 
+
             # List-index syntax allows a template to access a certain item of a subscriptable object.
             'list-index01': ("{{ var.1 }}", {"var": ["first item", "second item"]}, "second item"),