2007-12-03 07:57:22 +08:00
|
|
|
# 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
|
2009-12-14 20:08:23 +08:00
|
|
|
>>> c.get('a')
|
|
|
|
2
|
2007-12-03 07:57:22 +08:00
|
|
|
>>> c.pop()
|
|
|
|
{'a': 2}
|
|
|
|
>>> c['a']
|
|
|
|
1
|
2009-12-14 20:08:23 +08:00
|
|
|
>>> c.get('foo', 42)
|
|
|
|
42
|
2007-12-03 07:57:22 +08:00
|
|
|
"""
|
|
|
|
|