예제 #1
0
 def test_find_creates_external_system_if_not_found_and_create_is_true(
         self, ExternalSystem):
     ExternalSystem.DoesNotExist = Exception
     ExternalSystem.objects.get.side_effect = ExternalSystem.DoesNotExist
     ExternalSystemHelper.find('systemName', True)
     ExternalSystem.objects.create.assert_called_with(
         name='systemName', description='systemName')
예제 #2
0
 def test_find_creates_external_system_if_not_found_and_create_is_true(
         self, ExternalSystem):
     ExternalSystem.DoesNotExist = Exception
     ExternalSystem.objects.get.side_effect = ExternalSystem.DoesNotExist
     ExternalSystemHelper.find('systemName', True)
     ExternalSystem.objects.create.assert_called_with(
         name='systemName', description='systemName')
예제 #3
0
 def test_find_raises_error_if_external_system_not_found(self):
     with self.assertRaises(CommandError):
         ExternalSystemHelper.find('systemName', False)
예제 #4
0
 def test_find_raises_error_if_external_system_name_is_blank(self):
     with self.assertRaises(CommandError):
         ExternalSystemHelper.find('')
예제 #5
0
 def test_find_raises_error_if_external_system_not_found(self):
     with self.assertRaises(CommandError):
         ExternalSystemHelper.find('systemName', False)
예제 #6
0
 def test_find_raises_error_if_external_system_name_is_blank(self):
     with self.assertRaises(CommandError):
         ExternalSystemHelper.find('')