def test_abandon_environment_is_allowed_with_environment(self): self.abandon_environment = tables.AbandonEnvironment() test_environment = mock.Mock() test_environment.status = "test" self.assertTrue(self.abandon_environment.allowed("", test_environment)) test_environment.status = "pending" self.assertFalse(self.abandon_environment.allowed( "", test_environment))
def test_abandon_environment_action_fail(self, exceptions, reverse): self.abandon_environment = tables.AbandonEnvironment() exceptions.handle.return_value = "" self.abandon_environment.action("", "") self.assertTrue(reverse.called)
def test_abandon_environment_action(self, delete): self.abandon_environment = tables.AbandonEnvironment() self.abandon_environment.action("", "") self.assertTrue(delete.called)
def test_abandoin_environment_is_allowed_without_environment( self, actions): self.abandon_environment = tables.AbandonEnvironment() actions.return_value = True self.assertTrue(self.abandon_environment.allowed("", ""))