def test_create_duplicate_database_error(self): database = Database(name="bleble", databaseinfra=self.databaseinfra, environment=self.environment) database.save() self.assertTrue(database.pk) self.assertRaises(IntegrityError, Database(name="bleble", databaseinfra=self.databaseinfra, environment=self.environment).save)
def database(self): from logical.models import Database if self.infra.databases.exists(): return self.infra.databases.first() database = Database() database.name = self.infra.databases_create.last().name return database
def test_create_database(self): database = Database(name="blabla", databaseinfra=self.databaseinfra, environment=self.environment) database.save() self.assertTrue(database.pk)
def database(self): from logical.models import Database if self.infra.databases.exists(): return self.infra.databases.first() database = Database() step_manager = self.infra.databases_create.last() database.name = (step_manager.name if step_manager else self.step_manager.name) return database
def setUp(self): self.fake_database_create = DatabaseCreate() self.fake_database_create.task = TaskHistoryFactory.build() self.fake_database = Database()
def database(self): from logical.models import Database database = Database() database.name = self.infra.databases_create.last().name return database