#24859: UUIDField does not Properly Raise TyperError
-------------------------------------+-------------------------------------
     Reporter:  cancan101            |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * needs_better_patch:   => 0
 * component:  Uncategorized => Database layer (models, ORM)
 * needs_tests:   => 0
 * needs_docs:   => 0
 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Accepting in a similar vein to #24319. Here's a test that can be used to
 reproduce the issue:
 {{{
 #!diff
 diff --git a/tests/model_fields/test_uuid.py
 b/tests/model_fields/test_uuid.py
 index 21c2869..95d47b5 100644
 --- a/tests/model_fields/test_uuid.py
 +++ b/tests/model_fields/test_uuid.py
 @@ -37,6 +37,9 @@ class TestSaveLoad(TestCase):
          loaded = NullableUUIDModel.objects.get()
          self.assertEqual(loaded.field, None)

 +    def test_pk_validated(self):
 +        PrimaryKeyUUIDModel.objects.get(pk={})
 +
      def test_wrong_value(self):
          self.assertRaisesMessage(
              ValueError, 'badly formed hexadecimal UUID string',
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24859#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e05730c8b55073633c4d190533793e45%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to