1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

make tests run on python 2.7 also

This commit is contained in:
Alexis Metaireau 2012-04-01 19:39:26 +02:00
parent a9d9f1e6fd
commit 90acad67f9

View file

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os try:
import tempfile import unittest2 as unittest
import unittest2 as unittest except ImportError:
import unittest # NOQA
import base64 import base64
import json import json
@ -10,13 +12,14 @@ from flask import session
import run import run
import models import models
class TestCase(unittest.TestCase): class TestCase(unittest.TestCase):
def setUp(self): def setUp(self):
run.app.config['TESTING'] = True run.app.config['TESTING'] = True
run.app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///memory" 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() self.app = run.app.test_client()
models.db.init_app(run.app) models.db.init_app(run.app)
@ -51,6 +54,7 @@ class TestCase(unittest.TestCase):
password=name, contact_email="%s@notmyidea.org" % name)) password=name, contact_email="%s@notmyidea.org" % name))
models.db.session.commit() models.db.session.commit()
class BudgetTestCase(TestCase): class BudgetTestCase(TestCase):
def test_notifications(self): def test_notifications(self):