Skip to content

Commit 6110b15

Browse files
committed
Modified an API test to make it pickleable (for parallel test runs).
- Legacy-Id: 13156
1 parent 7dafab0 commit 6110b15

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/api/tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, *args, **kwargs):
2929
name = app_name.split('.',1)[-1]
3030
models_path = os.path.join(os.path.dirname(app.__file__), "models.py")
3131
if os.path.exists(models_path):
32-
self.apps[name] = app
32+
self.apps[name] = app_name
3333
super(TastypieApiTestCase, self).__init__(*args, **kwargs)
3434

3535
def test_api_top_level(self):
@@ -76,7 +76,8 @@ def test_all_model_resources_exist(self):
7676
top = json.loads(r.content)
7777
self._assertCallbackReturnsSameJSON("/api/v1", top)
7878
for name in self.apps:
79-
app = self.apps[name]
79+
app_name = self.apps[name]
80+
app = import_module(app_name)
8081
self.assertEqual("/api/v1/%s/"%name, top[name]["list_endpoint"])
8182
r = client.get(top[name]["list_endpoint"])
8283
self.assertValidJSONResponse(r)

0 commit comments

Comments
 (0)