+++ /dev/null
-[pytest]
-DJANGO_SETTINGS_MODULE=telemeta.tests.settings_sqlite
--- /dev/null
+from django.conf import settings
+
+def pytest_configure():
+ settings.configure(#SECRET_KEY = 'test_key'
+ INSTALLED_APPS=('django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.messages',
+ 'suit',
+ 'django.contrib.admin',
+ 'django.contrib.staticfiles',
+ 'django_extensions',
+ 'telemeta',),
+ DATABASES={
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': ':memory:'
+ },
+ }
+ )
# David LIPSZYC <davidlipszyc@gmail.com>
from django.contrib.auth.models import User
-from django.test import TestCase
+
from telemeta.models import LocationType, Location, EthnicGroup
from telemeta.models.enum import Publisher, PublisherCollection
pytestmark = pytest.mark.django_db
@pytest.mark.django_db
-class CollectionItemTestCase(TestCase):
+class CollectionItemTestCase:
pytestmark = pytest.mark.django_db
def setUp(self):
pytestmark = pytest.mark.django_db
@pytest.mark.django_db
-class RelatedDeleteTestCase(TestCase):
+class RelatedDeleteTestCase:
pytestmark = pytest.mark.django_db
def setUp(self):
#
# Authors: Olivier Guilyardi <olivier@samalyse.com>
-import unittest
+from django.test import TestCase
from telemeta.util.unaccent import unaccent_icmp
-class UnaccentTestCase(unittest.TestCase):
+class UnaccentTestCase(TestCase):
def testSorting(self):
strings = [u'Métro', u'évasion', u'àccent', u'È', u'île', u'arrivée', u'elle']
strings.sort(unaccent_icmp)