--- a/ForgeLink/forgelink/tests/test_app.py
+++ b/ForgeLink/forgelink/tests/test_app.py
@@ -19,10 +19,10 @@
 import json
 
 from nose.tools import assert_equal
+from pylons import tmpl_context as c
 
 from allura.tests import decorators as td
 from allura import model as M
-from allura.lib import helpers as h
 from alluratest.controller import setup_basic_test
 
 
@@ -33,11 +33,14 @@
 
     @td.with_link
     def test_bulk_export(self):
-        self.project = M.Project.query.get(shortname='test')
-        self.link = self.project.app_instance('link')
-        h.set_context(self.project._id, app_config_id=self.link.config._id)
-        self.link.config.options['url'] = 'http://sf.net'
+        # Clear out some context vars, to properly simulate how this is run from the export task
+        # Besides, it's better not to need c context vars
+        c.app = c.project = None
+
+        project = M.Project.query.get(shortname='test')
+        link = project.app_instance('link')
+        link.config.options['url'] = 'http://sf.net'
         f = tempfile.TemporaryFile()
-        self.link.bulk_export(f)
+        link.bulk_export(f)
         f.seek(0)
         assert_equal(json.loads(f.read())['url'], 'http://sf.net')