#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 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]?

 The latter is in charge of
 
[https://github.com/django/django/blob/b9cf764be62e77b4777b3a75ec256f6209a57671/django/contrib/postgres/apps.py#L11-L28
 connecting a signal receiver] that
 
[https://github.com/django/django/blob/b9cf764be62e77b4777b3a75ec256f6209a57671/django/contrib/postgres/signals.py#L37-L43
 registers] the necessary `psycopg2` adapters on connection creation.

 If that's the origin of your issue I suggest we re-purpose this ticket to
 add system checks to all `django.contrib.postgres.fields` that errors when
 a field is used but `self.model._meta.apps.get('postgres')` is missing.

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

Reply via email to