Fixed test failures with Oracle when pytz isn't installed.

Thanks Shai Berger for the report.
This commit is contained in:
Aymeric Augustin 2013-05-19 14:38:16 +02:00
parent 761bbbbbae
commit 181f2ec603
1 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,11 @@ except ImportError as e:
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e) raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
try:
import pytz
except ImportError:
pytz = None
from django.db import utils from django.db import utils
from django.db.backends import * from django.db.backends import *
from django.db.backends.oracle.client import DatabaseClient from django.db.backends.oracle.client import DatabaseClient
@ -77,6 +82,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_subqueries_in_group_by = False supports_subqueries_in_group_by = False
supports_transactions = True supports_transactions = True
supports_timezones = False supports_timezones = False
has_zoneinfo_database = pytz is not None
supports_bitwise_or = False supports_bitwise_or = False
can_defer_constraint_checks = True can_defer_constraint_checks = True
ignores_nulls_in_unique_constraints = False ignores_nulls_in_unique_constraints = False