Modified an API test to make it pickleable (for parallel test runs).
- Legacy-Id: 13156
This commit is contained in:
parent
7dafab0b30
commit
6110b15de1
|
@ -29,7 +29,7 @@ class TastypieApiTestCase(ResourceTestCaseMixin, TestCase):
|
|||
name = app_name.split('.',1)[-1]
|
||||
models_path = os.path.join(os.path.dirname(app.__file__), "models.py")
|
||||
if os.path.exists(models_path):
|
||||
self.apps[name] = app
|
||||
self.apps[name] = app_name
|
||||
super(TastypieApiTestCase, self).__init__(*args, **kwargs)
|
||||
|
||||
def test_api_top_level(self):
|
||||
|
@ -76,7 +76,8 @@ class TastypieApiTestCase(ResourceTestCaseMixin, TestCase):
|
|||
top = json.loads(r.content)
|
||||
self._assertCallbackReturnsSameJSON("/api/v1", top)
|
||||
for name in self.apps:
|
||||
app = self.apps[name]
|
||||
app_name = self.apps[name]
|
||||
app = import_module(app_name)
|
||||
self.assertEqual("/api/v1/%s/"%name, top[name]["list_endpoint"])
|
||||
r = client.get(top[name]["list_endpoint"])
|
||||
self.assertValidJSONResponse(r)
|
||||
|
|
Loading…
Reference in a new issue