mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
fix a unicode handling bug
see: https://github.com/ansible/ansible-tower/issues/7843 related: https://github.com/ansible/awx/pull/807
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import pytest
|
||||
import mock
|
||||
import six
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
@@ -156,6 +159,14 @@ def test_inventory_update_name(inventory, inventory_source):
|
||||
assert iu.name == inventory.name + ' - ' + inventory_source.name
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_inventory_name_with_unicode(inventory, inventory_source):
|
||||
inventory.name = six.u('オオオ')
|
||||
inventory.save()
|
||||
iu = inventory_source.update()
|
||||
assert iu.name.startswith(inventory.name)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_inventory_update_excessively_long_name(inventory, inventory_source):
|
||||
inventory.name = 'a' * 400 # field max length 512
|
||||
|
||||
Reference in New Issue
Block a user