Skip to content

Commit 5371f79

Browse files
committed
monkeypatch oracle bug on earlier django versions to get tests to work
1 parent 3d8b6e9 commit 5371f79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django_enum/tests/tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@
7171
###############################################################################
7272
# monkey patch a fix to django oracle backend bug, blocks all oracle tests
7373
from django.db.backends.oracle.schema import DatabaseSchemaEditor
74-
74+
from django.utils.duration import duration_iso_string
7575
quote_value = DatabaseSchemaEditor.quote_value
7676

7777

7878
def quote_value_patched(self, value):
7979
if isinstance(value, date) and not isinstance(value, datetime):
8080
return "DATE '%s'" % value.isoformat()
81+
elif isinstance(value, timedelta):
82+
return "'%s'" % duration_iso_string(value)
8183
return quote_value(self, value)
8284

8385

0 commit comments

Comments
 (0)