From 388bb5bd9aa3cd43825cd8a3632a57d8204f875f Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 23 Apr 2016 19:13:31 +0200 Subject: Fixed #22936 -- Obsoleted Field.get_prep_lookup()/get_db_prep_lookup() Thanks Tim Graham for completing the initial patch. --- tests/model_fields/test_custom_fields.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 tests/model_fields/test_custom_fields.py (limited to 'tests/model_fields/test_custom_fields.py') diff --git a/tests/model_fields/test_custom_fields.py b/tests/model_fields/test_custom_fields.py deleted file mode 100644 index c41e19416e..0000000000 --- a/tests/model_fields/test_custom_fields.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.db import connection, models -from django.test import SimpleTestCase - - -class CustomFieldTests(SimpleTestCase): - - def test_get_prep_value_count(self): - """ - Field values are not prepared twice in get_db_prep_lookup() (#14786). - """ - class NoopField(models.TextField): - def __init__(self, *args, **kwargs): - self.prep_value_count = 0 - super(NoopField, self).__init__(*args, **kwargs) - - def get_prep_value(self, value): - self.prep_value_count += 1 - return super(NoopField, self).get_prep_value(value) - - field = NoopField() - field.get_db_prep_lookup('exact', 'TEST', connection=connection, prepared=False) - self.assertEqual(field.prep_value_count, 1) -- cgit v1.3