File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
61
61
"aggregation.tests.AggregateTestCase.test_aggregation_default_passed_another_aggregate" ,
62
62
"aggregation.tests.AggregateTestCase.test_annotation_expressions" ,
63
63
"aggregation.tests.AggregateTestCase.test_reverse_fkey_annotate" ,
64
- # AutoField (IntegerField) validators crash MongoAutoField.
65
- "model_forms.tests.ModelFormBasicTests.test_recleaning_model_form_instance" ,
66
64
}
67
65
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
68
66
_django_test_expected_failures_bitwise = {
Original file line number Diff line number Diff line change 1
1
from bson import ObjectId , errors
2
2
from django .core import exceptions
3
3
from django .db .models .fields import AutoField , Field
4
+ from django .utils .functional import cached_property
4
5
from django .utils .translation import gettext_lazy as _
5
6
6
7
@@ -41,3 +42,8 @@ def to_python(self, value):
41
42
code = "invalid" ,
42
43
params = {"value" : value },
43
44
) from None
45
+
46
+ @cached_property
47
+ def validators (self ):
48
+ # Avoid IntegerField validators inherited from AutoField.
49
+ return [* self .default_validators , * self ._validators ]
You can’t perform that action at this time.
0 commit comments