Example #1
0
    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))
Example #2
0
 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)
Example #3
0
 def test_abandon_environment_action(self, delete):
     self.abandon_environment = tables.AbandonEnvironment()
     self.abandon_environment.action("", "")
     self.assertTrue(delete.called)
Example #4
0
 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("", ""))