aboutsummaryrefslogtreecommitdiff
path: root/budget/tests.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2012-04-01 19:39:26 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2012-04-01 19:39:26 +0200
commit90acad67f9add84cfce4bcb996cae2d6a16b0ae0 (patch)
treecd46763c15092f3f1d1518442e1c300a68ada2b0 /budget/tests.py
parenta9d9f1e6fdc8e1981bdbf864332ddac746e53667 (diff)
downloadihatemoney-mirror-90acad67f9add84cfce4bcb996cae2d6a16b0ae0.zip
ihatemoney-mirror-90acad67f9add84cfce4bcb996cae2d6a16b0ae0.tar.gz
ihatemoney-mirror-90acad67f9add84cfce4bcb996cae2d6a16b0ae0.tar.bz2
make tests run on python 2.7 also
Diffstat (limited to 'budget/tests.py')
-rw-r--r--budget/tests.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/budget/tests.py b/budget/tests.py
index 5e03cde..85d9f39 100644
--- a/budget/tests.py
+++ b/budget/tests.py
@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
-import os
-import tempfile
-import unittest2 as unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest # NOQA
+
import base64
import json
@@ -10,13 +12,14 @@ from flask import session
import run
import models
+
class TestCase(unittest.TestCase):
def setUp(self):
run.app.config['TESTING'] = True
run.app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///memory"
- run.app.config['CSRF_ENABLED'] = False # simplify the tests
+ run.app.config['CSRF_ENABLED'] = False # simplify the tests
self.app = run.app.test_client()
models.db.init_app(run.app)
@@ -51,6 +54,7 @@ class TestCase(unittest.TestCase):
password=name, contact_email="%s@notmyidea.org" % name))
models.db.session.commit()
+
class BudgetTestCase(TestCase):
def test_notifications(self):