class DisableInactiveTestCase(MyBaseTest): def setUp(self): MyBaseTest.setUp(self) self.cmd = DisableInactiveCommand() @patch("fwadmin.management.commands.disableinactive.ldap_user_exists") def test_no_gen_rules_expired(self, mock_f): mock_f.return_value = False self.assertEqual(self.host.active, True) self.assertEqual(self.host.approved, True) self.cmd.handle() # we need to "refresh" the host from the Db self.host is stale host_from_db = Host.objects.filter(pk=self.host.pk)[0] self.assertEqual(host_from_db.active, False)
def setUp(self): MyBaseTest.setUp(self) self.cmd = DisableInactiveCommand()