1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00
django/tests/get_or_create
Jon Dufresne b39aabc6c6 Refs #27795 -- Reworked get_or_create test erroneously mixing bytes and str.
As CharField.to_python() now always calls str(), assigning bytes to a
CharField is no longer correct usage. Doing so results in a warning:

  django/db/models/fields/__init__.py:1061: BytesWarning: str() on a bytes instance

Use a unique constraint violation to trigger the database error instead.

Warning introduced in 301de774c2.
2017-05-01 08:47:49 -04:00
..
__init__.py
models.py Refs #23919 -- Removed python_2_unicode_compatible decorator usage 2017-01-18 13:44:34 +01:00
tests.py Refs #27795 -- Reworked get_or_create test erroneously mixing bytes and str. 2017-05-01 08:47:49 -04:00