def test_clean_with_path_conflict_with_archived(self): """Testing Repository.clean with archived repositories ignored for path conflict """ self.repository.archive() repository = Repository(name='New test repo', path=self.repository.path, tool=self.repository.tool) with self.assertNumQueries(1): repository.clean()
def test_clean_with_path_conflict_with_archived(self): """Testing Repository.clean with archived repositories ignored for path conflict """ self.repository.archive() repository = Repository(name='New test repo', path=self.repository.path, tool=self.repository.tool) with self.assertNumQueries(1): repository.clean()
def test_clean_with_path_conflict(self): """Testing Repository.clean with path conflict""" repository = Repository(name='New test repo', path=self.repository.path, tool=self.repository.tool) with self.assertRaises(ValidationError) as ctx: with self.assertNumQueries(1): repository.clean() self.assertEqual(ctx.exception.message_dict, { 'path': ['A repository with this path already exists'], })
def test_clean_with_name_conflict(self): """Testing Repository.clean with name conflict""" repository = Repository(name=self.repository.name, path='path/to/repo.git', tool=self.repository.tool) with self.assertRaises(ValidationError) as ctx: with self.assertNumQueries(1): repository.clean() self.assertEqual(ctx.exception.message_dict, { 'name': ['A repository with this name already exists'], })
def test_clean_with_path_conflict(self): """Testing Repository.clean with path conflict""" repository = Repository(name='New test repo', path=self.repository.path, tool=self.repository.tool) with self.assertRaises(ValidationError) as ctx: with self.assertNumQueries(1): repository.clean() self.assertEqual(ctx.exception.message_dict, { 'path': ['A repository with this path already exists'], })
def test_clean_with_name_conflict(self): """Testing Repository.clean with name conflict""" repository = Repository(name=self.repository.name, path='path/to/repo.git', tool=self.repository.tool) with self.assertRaises(ValidationError) as ctx: with self.assertNumQueries(1): repository.clean() self.assertEqual(ctx.exception.message_dict, { 'name': ['A repository with this name already exists'], })