From f7b0532ec0cf703849ef50e513e3dc6b5483a6b0 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 18 Sep 2017 14:29:47 -0400 Subject: Refs #28334 -- Fixed crash in hstore/citext oid caching during test db creation. --- tests/postgres_tests/test_signals.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_signals.py b/tests/postgres_tests/test_signals.py index a7112f014c..87d0f8bfa8 100644 --- a/tests/postgres_tests/test_signals.py +++ b/tests/postgres_tests/test_signals.py @@ -3,7 +3,9 @@ from django.db import connection from . import PostgreSQLTestCase try: - from django.contrib.postgres.signals import get_hstore_oids, get_citext_oids + from django.contrib.postgres.signals import ( + get_citext_oids, get_hstore_oids, register_type_handlers, + ) except ImportError: pass # pyscogp2 isn't installed. @@ -31,3 +33,7 @@ class OIDTests(PostgreSQLTestCase): def test_citext_values(self): oids = get_citext_oids(connection.alias) self.assertOIDs(oids) + + def test_register_type_handlers_no_db(self): + """Registering type handlers for the nodb connection does nothing.""" + register_type_handlers(connection._nodb_connection) -- cgit v1.3