Fixed #20392 -- Added TestCase.setUpTestData()

Each TestCase is also now wrapped in a class-wide transaction.
This commit is contained in:
Thomas Chaumeny 2014-10-18 23:01:13 +02:00 committed by Tim Graham
parent dee4d23f7e
commit da9fe5c717
7 changed files with 136 additions and 35 deletions

View file

@ -2,12 +2,15 @@ from __future__ import unicode_literals
from django.db import connection
from django.db.utils import DatabaseError
from django.test import TestCase, skipUnlessDBFeature
from django.test import TransactionTestCase, skipUnlessDBFeature
from .models import Reporter, Article
class IntrospectionTests(TestCase):
class IntrospectionTests(TransactionTestCase):
available_apps = ['introspection']
def test_table_names(self):
tl = connection.introspection.table_names()
self.assertEqual(tl, sorted(tl))