Пример #1
0
    def test_creating_new_domains(self):
        domain = Domain()
        domain.id = 42
        domain.name = "Test VM"
        domain.state = domain.RUNNING
        domain.max_memory = 2*2024*2024
        domain.memory = domain.max_memory
        domain.vcpu = 1
        domain.save()

        all_domains_in_database = Domain.objects.all()
        self.assertEquals(len(all_domains_in_database), 1)
        only_domain_in_database = all_domains_in_database[0]
        self.assertEquals(only_domain_in_database, domain)

        self.assertEquals(only_domain_in_database.name, "Test VM")