summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates/context.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-02 23:57:22 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-02 23:57:22 +0000
commit67373009e053aca469f857be99158564fc9b42f0 (patch)
treebc27744bb9bca4cb69fecac92f07616034a39941 /tests/regressiontests/templates/context.py
parenta88ca126fcfe579a38f3e94a7668b626f0e468c3 (diff)
Fixed #4563 -- Context.pop/push/update return the top-level dictionary (the new
one for push() and update(), the one removed for pop()). Based on a patch from Brian Harring. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/context.py')
-rw-r--r--tests/regressiontests/templates/context.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/context.py b/tests/regressiontests/templates/context.py
new file mode 100644
index 0000000000..d8b0f39abe
--- /dev/null
+++ b/tests/regressiontests/templates/context.py
@@ -0,0 +1,18 @@
+# coding: utf-8
+
+context_tests = r"""
+>>> from django.template import Context
+>>> c = Context({'a': 1, 'b': 'xyzzy'})
+>>> c['a']
+1
+>>> c.push()
+{}
+>>> c['a'] = 2
+>>> c['a']
+2
+>>> c.pop()
+{'a': 2}
+>>> c['a']
+1
+"""
+