1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #33308 -- Added support for psycopg version 3.

Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews.

Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
Daniele Varrazzo
2022-12-01 20:23:43 +01:00
committed by Mariusz Felisiak
parent d44ee518c4
commit 09ffc5c121
42 changed files with 673 additions and 223 deletions

View File

@@ -916,15 +916,11 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
with self.assertRaisesMessage(IntegrityError, msg):
management.call_command("loaddata", "invalid.json", verbosity=0)
@unittest.skipUnless(
connection.vendor == "postgresql", "psycopg2 prohibits null characters in data."
)
@skipUnlessDBFeature("prohibits_null_characters_in_text_exception")
def test_loaddata_null_characters_on_postgresql(self):
msg = (
"Could not load fixtures.Article(pk=2): "
"A string literal cannot contain NUL (0x00) characters."
)
with self.assertRaisesMessage(ValueError, msg):
error, msg = connection.features.prohibits_null_characters_in_text_exception
msg = f"Could not load fixtures.Article(pk=2): {msg}"
with self.assertRaisesMessage(error, msg):
management.call_command("loaddata", "null_character_in_field_value.json")
def test_loaddata_app_option(self):