#34849: Appending django.contrib.postgres to the INSTALLED_APPS via
@modify_settings crashes.
-------------------------------------+-------------------------------------
     Reporter:  Mariusz Felisiak     |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  5.0
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

 Here's a failing test that I came up with:

 {{{
 --- a/tests/postgres_tests/test_apps.py
 +++ b/tests/postgres_tests/test_apps.py
 @@ -5,7 +5,8 @@ from django.db import connection
  from django.db.backends.signals import connection_created
  from django.db.migrations.writer import MigrationWriter
  from django.test import TestCase
 -from django.test.utils import modify_settings
 +from django.test.utils import modify_settings, override_settings
 +from django.contrib.postgres.signals import get_hstore_oids

  try:
      from django.contrib.postgres.fields import (
 @@ -27,6 +28,11 @@ except ImportError:

  @unittest.skipUnless(connection.vendor == "postgresql", "PostgreSQL
 specific tests")
  class PostgresConfigTests(TestCase):
 +    def test_install_app(self):
 +        get_hstore_oids.cache_clear()
 +        with
 override_settings(INSTALLED_APPS=["django.contrib.postgres"]):
 +            pass
 +
      def test_register_type_handlers_connection(self):
          from django.contrib.postgres.signals import
 register_type_handlers
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34849#comment:8>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018abb113d5c-0a297476-a7ce-4af5-bf25-1f409e02ba09-000000%40eu-central-1.amazonses.com.

Reply via email to