summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_apps.py
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2018-11-12 11:15:48 -0500
committerTim Graham <timograham@gmail.com>2018-11-12 11:15:48 -0500
commit2f120ac51722a257219a7577759702605cefddf4 (patch)
tree05b9c93c70fcbe9b795af67ca59e2dac44ce4626 /tests/postgres_tests/test_apps.py
parentb1243a55a5916ed08a726b011bc05d40f717ef40 (diff)
Fixed #29945 -- Moved contrib.postgres uninstallation logic to the app config.
Diffstat (limited to 'tests/postgres_tests/test_apps.py')
-rw-r--r--tests/postgres_tests/test_apps.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_apps.py b/tests/postgres_tests/test_apps.py
new file mode 100644
index 0000000000..a5740f9d15
--- /dev/null
+++ b/tests/postgres_tests/test_apps.py
@@ -0,0 +1,13 @@
+from django.db.backends.signals import connection_created
+from django.test.utils import modify_settings
+
+from . import PostgreSQLTestCase
+
+
+class PostgresConfigTests(PostgreSQLTestCase):
+ def test_register_type_handlers_connection(self):
+ from django.contrib.postgres.signals import register_type_handlers
+ self.assertNotIn(register_type_handlers, connection_created._live_receivers(None))
+ with modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'}):
+ self.assertIn(register_type_handlers, connection_created._live_receivers(None))
+ self.assertNotIn(register_type_handlers, connection_created._live_receivers(None))