From 1e4da439556cdd69eb9f91e07f99cf77997e70d2 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 16 Dec 2022 12:24:49 +0100 Subject: [PATCH] Fixed lookup.tests.LookupTests.test_exact_none_transform() test on Oracle. NulledTransform doesn't return TextField anymore so it cannot be wrapped with DBMS_LOB.SUBSTR(). Test regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca. --- tests/lookup/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/lookup/models.py b/tests/lookup/models.py index 86f774ea11..9bb3412c33 100644 --- a/tests/lookup/models.py +++ b/tests/lookup/models.py @@ -50,11 +50,22 @@ class NulledTextField(models.TextField): return None if value == "" else value +class NullField(models.Field): + pass + + +NullField.register_lookup(IsNull) + + @NulledTextField.register_lookup class NulledTransform(models.Transform): lookup_name = "nulled" template = "NULL" + @property + def output_field(self): + return NullField() + @NulledTextField.register_lookup class IsNullWithNoneAsRHS(IsNull):