from django.contrib.auth.models import User
from django.test import TestCase

from core import models


class ModelVariable(TestCase):

    def setUp(self):
        models.Variable.objects.create(
            name='qwer',
            value='asdf',
        )

    def test_str(self):
        variable = models.Variable.objects.get(name='qwer')

        self.assertEqual(str(variable), 'qwer: asdf')


class ModelHostGroup(TestCase):

    def setUp(self):
        models.HostGroup.objects.create(
            name='qwer',
        )

    def test_str(self):
        host_group = models.HostGroup.objects.get(name='qwer')

        self.assertEqual(str(host_group), 'qwer')


class ModelHost(TestCase):

    def setUp(self):
        models.Host.objects.create(
            name='qwer',
            address='192.168.12.20',
        )