diff options
author | Code Raguet <ignacio.code@gmail.com> | 2013-10-01 18:40:10 (GMT) |
---|---|---|
committer | Code Raguet <ignacio.code@gmail.com> | 2013-10-01 18:40:10 (GMT) |
commit | 5e866f2aba1d3602ab6604d8c79e56e295fb9f5a (patch) | |
tree | 2aa9327ddd7d60e458cebbc05783c88f704e5299 /webapp/webapp/features/terrain.py | |
parent | 88d7d7874be689e2cf84df93c7904774e4be2314 (diff) |
refactor load_mongo_fixture func to search in poll's fixtures
Diffstat (limited to 'webapp/webapp/features/terrain.py')
-rw-r--r-- | webapp/webapp/features/terrain.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/webapp/webapp/features/terrain.py b/webapp/webapp/features/terrain.py index 117c245..9c9e6ce 100644 --- a/webapp/webapp/features/terrain.py +++ b/webapp/webapp/features/terrain.py @@ -39,9 +39,16 @@ def load_fixture(fixture_name): def load_mongo_fixture(fixture_name, collection): - POLLSTER_FIXTURES = os.path.join(settings.PROJECT_ROOT, - '../pollster/fixtures') - fixture_path = os.path.join(POLLSTER_FIXTURES, fixture_name + ".json") + pollster_fixture_dir = os.path.join(settings.PROJECT_ROOT, + '../pollster/fixtures') + polls_fixture_dir = os.path.join(settings.PROJECT_ROOT, + '../polls/fixtures') + fixtures = { + 'pollsters': pollster_fixture_dir, + 'polls': polls_fixture_dir, + } + fixture_dir = fixtures[collection] + fixture_path = os.path.join(fixture_dir, fixture_name + ".json") kwargs = { 'db': settings.MONGO_SETTINGS['NAME'], 'collection': collection, |