From 152ae52a6dd89fd7ff19ec8d6ea0c78c5ecc67a8 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Sat, 18 Dec 2010 17:37:19 +0000 Subject: [PATCH] Fixed the ModelMultipleChoiceFieldTests to pass even on DB backends that do not reuse pk values after rollback. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14928 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/model_forms_regress/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py index 2e2afd6c05..2aedf2fa65 100644 --- a/tests/regressiontests/model_forms_regress/tests.py +++ b/tests/regressiontests/model_forms_regress/tests.py @@ -37,7 +37,8 @@ class ModelMultipleChoiceFieldTests(TestCase): f = forms.ModelMultipleChoiceField(queryset=Person.objects.all(), validators=[my_validator]) - f.clean([1,2]) + + f.clean([p.pk for p in Person.objects.all()[8:9]]) self.assertTrue(self._validator_run) class TripleForm(forms.ModelForm):