From 67373009e053aca469f857be99158564fc9b42f0 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 2 Dec 2007 23:57:22 +0000 Subject: 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 --- tests/regressiontests/templates/context.py | 18 ++++++++++++++++++ tests/regressiontests/templates/tests.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 tests/regressiontests/templates/context.py (limited to 'tests') 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 +""" + diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index cbbd88b06c..846023afc9 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -18,11 +18,13 @@ from django.utils.safestring import mark_safe from django.utils.tzinfo import LocalTimezone from unicode import unicode_tests +from context import context_tests import filters # Some other tests we would like to run __test__ = { 'unicode': unicode_tests, + 'context': context_tests, } ################################# -- cgit v1.3