summaryrefslogtreecommitdiffstats
path: root/askbot/tests/utils.py
diff options
context:
space:
mode:
authorTomasz Zielinski <tomasz.zielinski@pyconsultant.eu>2011-12-10 18:38:50 +0100
committerTomasz Zielinski <tomasz.zielinski@pyconsultant.eu>2011-12-10 18:38:50 +0100
commit0091a515009d227e897f8c2aa075940f112f9b9f (patch)
treed2f2a95392b6569b02886d151f45d0b2ed3ba78f /askbot/tests/utils.py
parentb159c234d18c9c1cd4236f5ef37ad89cd284e480 (diff)
downloadaskbot-0091a515009d227e897f8c2aa075940f112f9b9f.tar.gz
askbot-0091a515009d227e897f8c2aa075940f112f9b9f.tar.bz2
askbot-0091a515009d227e897f8c2aa075940f112f9b9f.zip
Tickets 104, 107: User_stats finalization
Diffstat (limited to 'askbot/tests/utils.py')
-rw-r--r--askbot/tests/utils.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/askbot/tests/utils.py b/askbot/tests/utils.py
index 54a2a0ec..be2551e4 100644
--- a/askbot/tests/utils.py
+++ b/askbot/tests/utils.py
@@ -62,6 +62,23 @@ class AskbotTestCase(TestCase):
to django TestCase class
"""
+ def _fixture_setup(self):
+ # HACK: Create askbot_post database VIEW for the purpose of performing tests
+ import os.path
+ from django.conf import settings
+ from django.db import connection
+ sql = open(os.path.join(settings.PROJECT_ROOT, 'askbot', 'models', 'post_view.sql'), 'rt').read()
+ cursor = connection.cursor()
+ cursor.execute(sql)
+ super(AskbotTestCase, self)._fixture_setup()
+
+ def _fixture_teardown(self):
+ super(AskbotTestCase, self)._fixture_teardown()
+ from django.db import connection
+ cursor = connection.cursor()
+ cursor.execute('DROP VIEW IF EXISTS askbot_post')
+
+
def create_user(
self,
username = 'user',