@@ -356,8 +356,8 @@ def call_validator(*args, **kwargs):
356356 call_validator (valid_value )
357357
358358
359- def test_no_nul_characters_with_invalid_value ():
360- """no_nul_characters () should raise Invalid for any string containing
359+ def test_no_nul_byte_with_invalid_value ():
360+ """no_nul_byte () should raise Invalid for any string containing
361361 the NUL byte. PostgreSQL text columns reject NUL and psycopg2 raises
362362 ValueError before the query is sent, so unguarded input becomes a 500.
363363 """
@@ -371,11 +371,11 @@ def test_no_nul_characters_with_invalid_value():
371371 ]
372372
373373 for invalid_value in invalid_values :
374- raises_invalid (validators .no_nul_characters )(invalid_value , context = {})
374+ raises_invalid (validators .no_nul_byte )(invalid_value , context = {})
375375
376376
377- def test_no_nul_characters_with_valid_value ():
378- """no_nul_characters () should return the value unchanged for any string
377+ def test_no_nul_byte_with_valid_value ():
378+ """no_nul_byte () should return the value unchanged for any string
379379 that doesn't contain the NUL byte, including strings with other control
380380 characters and non-ASCII Unicode (which PostgreSQL accepts)."""
381381 valid_values = [
@@ -391,7 +391,7 @@ def test_no_nul_characters_with_valid_value():
391391 ]
392392
393393 for valid_value in valid_values :
394- returns_arg (validators .no_nul_characters )(valid_value )
394+ returns_arg (validators .no_nul_byte )(valid_value )
395395
396396
397397def test_strip_value_with_valid_value ():
0 commit comments