Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 15 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  tests/model_fields/tests.py
15  tests/model_fields/tests.py
@@ -81,6 +81,21 @@ class CustomChoiceField(forms.TypedChoiceField):
81 81
         field = models.CharField(choices=choices)
82 82
         klass = CustomChoiceField
83 83
         self.assertIsInstance(field.formfield(form_class=klass), klass)
  84
+        
  85
+    def test_field_prep_value_test(self):
  86
+        test_value = Whiz.objects.create(c=1)
  87
+        
  88
+        parent = BooleanModel()
  89
+        parent.bfield = True
  90
+        parent.string = test_value
  91
+        parent.save()
  92
+        
  93
+        parent_copy = BooleanModel.objects.get(pk=parent.pk)
  94
+        parent_copy.string = test_value
  95
+        parent_copy.save()
  96
+        
  97
+        parent_copy2 = BooleanModel.objects.get(pk=parent.pk)
  98
+        self.assertEqual(parent_copy2.string, parent.string)
84 99
 
85 100
 
86 101
 class DecimalFieldTests(test.TestCase):

No commit comments for this range

Something went wrong with that request. Please try again.