make inventory update name combination of inventory and source

This commit is contained in:
AlanCoding
2017-12-12 16:13:44 -05:00
parent 6e27294e2b
commit 08570fe785
2 changed files with 29 additions and 9 deletions

View File

@@ -149,6 +149,22 @@ def setup_inventory_groups(inventory, group_factory):
groupB.save()
@pytest.mark.django_db
def test_inventory_update_name(inventory, inventory_source):
iu = inventory_source.update()
assert inventory_source.name != inventory.name
assert iu.name == inventory.name + ' - ' + inventory_source.name
@pytest.mark.django_db
def test_inventory_update_excessively_long_name(inventory, inventory_source):
inventory.name = 'a' * 400 # field max length 512
inventory_source.name = 'b' * 400
iu = inventory_source.update()
assert inventory_source.name != inventory.name
assert iu.name.startswith(inventory.name)
@pytest.mark.django_db
class TestHostManager:
def test_host_filter_not_smart(self, setup_ec2_gce, organization):