#31221: HStoreField returns str instead of dict during tests
------------------------------------+--------------------------------------
     Reporter:  Michael Mulholland  |                    Owner:  (none)
         Type:  Uncategorized       |                   Status:  new
    Component:  contrib.postgres    |                  Version:  2.2
     Severity:  Normal              |               Resolution:
     Keywords:                      |             Triage Stage:  Unreviewed
    Has patch:  0                   |      Needs documentation:  0
  Needs tests:  0                   |  Patch needs improvement:  0
Easy pickings:  0                   |                    UI/UX:  0
------------------------------------+--------------------------------------

Comment (by Michael Mulholland):

 Replying to [comment:1 Simon Charette]:
 > Did you make sure to add `django.contrib.postgres` to your
 `INSTALLED_APPS`
 [https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/fields/#hstorefield
 as documented]?

 Yes, that was already in the installed apps when I encountered the
 problem.

 When I debug the test program, it does appear to be running
 register_type_handlers as expected during database setup. It also seems to
 be performing the deserialization to a python dict when the fixtures are
 loaded (using to_python). I'm not sure what it's doing with the models
 after that though, since there's nothing in the test db during testing,
 and accessing model instance values from the queryset gives the hstore
 formatted strings.
 So the test data I gave above turns into: {{{[(4, 'First', ''), (5,
 'Second', '"details"=>"this one isn\'t blank"')]}}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31221#comment:2>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.ca45de990d4482547e8c72c4d3d6601f%40djangoproject.com.

Reply via email to