mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.conf import settings
|
||||
from django.db import connection, DEFAULT_DB_ALIAS
|
||||
from django.test import TestCase
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.utils import functional
|
||||
|
||||
from models import Reporter, Article
|
||||
@@ -77,13 +77,13 @@ class IntrospectionTests(TestCase):
|
||||
)
|
||||
|
||||
# Regression test for #9991 - 'real' types in postgres
|
||||
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].startswith('django.db.backends.postgresql'):
|
||||
def test_postgresql_real_type(self):
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("CREATE TABLE django_ixn_real_test_table (number REAL);")
|
||||
desc = connection.introspection.get_table_description(cursor, 'django_ixn_real_test_table')
|
||||
cursor.execute('DROP TABLE django_ixn_real_test_table;')
|
||||
self.assertEqual(datatype(desc[0][1], desc[0]), 'FloatField')
|
||||
@skipUnlessDBFeature('has_real_datatype')
|
||||
def test_postgresql_real_type(self):
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("CREATE TABLE django_ixn_real_test_table (number REAL);")
|
||||
desc = connection.introspection.get_table_description(cursor, 'django_ixn_real_test_table')
|
||||
cursor.execute('DROP TABLE django_ixn_real_test_table;')
|
||||
self.assertEqual(datatype(desc[0][1], desc[0]), 'FloatField')
|
||||
|
||||
def test_get_relations(self):
|
||||
cursor = connection.cursor()
|
||||
|
||||
Reference in New Issue
Block a user