diff --git a/tests/backends/oracle/tests.py b/tests/backends/oracle/tests.py
index fd2435e5bb..39f11b4f0b 100644
a
|
b
|
|
1 | 1 | import unittest |
2 | 2 | |
| 3 | from ..models import Square |
| 4 | |
3 | 5 | from django.db import connection |
4 | 6 | from django.db.models.fields import BooleanField, NullBooleanField |
| 7 | from django.test import TransactionTestCase |
5 | 8 | |
6 | 9 | |
7 | 10 | @unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests') |
… |
… |
class Tests(unittest.TestCase):
|
61 | 64 | with self.subTest(field=field): |
62 | 65 | field.set_attributes_from_name('is_nice') |
63 | 66 | self.assertIn('"IS_NICE" IN (0,1)', field.db_check(connection)) |
| 67 | |
| 68 | |
| 69 | class TriggerException(TransactionTestCase): |
| 70 | available_apps = ['backends'] |
| 71 | |
| 72 | def test_database_trigger_exception_propagation(self): |
| 73 | # Exception raised by trigger should be propagate to user. |
| 74 | with connection.cursor() as cursor: |
| 75 | # Create trigger that always raise "ORA-1403: no data found". |
| 76 | cursor.execute(""" |
| 77 | CREATE OR REPLACE TRIGGER "TRG_NO_DATA_FOUND" |
| 78 | AFTER INSERT ON "BACKENDS_SQUARE" |
| 79 | FOR EACH ROW |
| 80 | BEGIN |
| 81 | RAISE NO_DATA_FOUND; |
| 82 | END; |
| 83 | """) |
| 84 | Square.objects.create(root=2, square=4) |