Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
 def setUp(self):
     MyBaseTest.setUp(self)
     self.cmd = DisableInactiveCommand()
Beispiel #4
0
 def setUp(self):
     MyBaseTest.setUp(self)
     self.cmd = DisableInactiveCommand()