<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -143,7 +143,12 @@ class TemplateInline(object):
             context = Context()
         context.update(self.kwargs)
         context['variant'] = self.variant
-        return render_to_string(self.get_template_name(), self.get_context(), context)
+        output = render_to_string(self.get_template_name(), self.get_context(), context)
+        # apparently in order to clean up properly we have to pop exactly twice. I need
+        # to trace through this to figure out exactly what's happening here, but this works.
+        context.pop()
+        context.pop()
+        return output
 
 
 class ModelInline(TemplateInline):</diff>
      <filename>django_inlines/inlines.py</filename>
    </modified>
    <modified>
      <diff>@@ -122,6 +122,16 @@ class ProcessInlinesTestCase(TestCase):
         }
         self.assertEqual(self.render(template, context), u'&lt;p&gt;This is my YouTube video: &lt;div class=&quot;youtube_video&quot;&gt;\n&lt;b&gt;C_ZebDKv1zo&lt;/b&gt;\n&lt;/div&gt;\n&lt;/p&gt;')
 
+    def test_that_context_gets_popped(self):
+        inlines.registry.register('youtube', YoutubeInline)
+
+        template = &quot;&quot;&quot;{% load inlines %}&lt;p&gt;{% process_inlines body in 'youtube_inlines' %} {{ test }}&lt;/p&gt;&quot;&quot;&quot;
+        context = {
+            'body': u&quot;This is my YouTube video: {{ youtube C_ZebDKv1zo bold=bold }} {{ youtube C_ZebDKv1zo }}&quot;,
+            'test': u&quot;green&quot;
+        }
+        self.assertEqual(self.render(template, context), u'&lt;p&gt;This is my YouTube video: &lt;div class=&quot;youtube_video&quot;&gt;\n&lt;b&gt;C_ZebDKv1zo&lt;/b&gt;\n&lt;/div&gt;\n &lt;div class=&quot;youtube_video&quot;&gt;\nC_ZebDKv1zo\n&lt;/div&gt;\n green&lt;/p&gt;')
+
     def test_usage_with_template_dirs_fallback(self):
         &quot;&quot;&quot;
         A if the a template in the specified dir doesn't exist it should fallback</diff>
      <filename>tests/core/tests/templatetags.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f9d724b2858dc5ecf68b7ee4fe3e93cce66d6a53</id>
    </parent>
  </parents>
  <author>
    <name>xian</name>
    <email>xian@mintchaos.com</email>
  </author>
  <url>http://github.com/mintchaos/django_inlines/commit/2f06c4f831be2e58d289ecb4b9f5b999a9e4e2ac</url>
  <id>2f06c4f831be2e58d289ecb4b9f5b999a9e4e2ac</id>
  <committed-date>2009-05-13T01:35:33-07:00</committed-date>
  <authored-date>2009-05-13T01:35:33-07:00</authored-date>
  <message>Made context clean up after itself.</message>
  <tree>c4d5ed80b740f78138bda130f3d8af2bc129f331</tree>
  <committer>
    <name>xian</name>
    <email>xian@mintchaos.com</email>
  </committer>
</commit>
