Ejemplo n.º 1
0
    def test_axes_config_log_re_entrant(self, log):
        """
        Test that log call count does not increase on repeat calls.
        """

        AppConfig.log()
        calls = log.info.call_count

        AppConfig.log()
        self.assertTrue(
            calls == log.info.call_count and calls > 0,
            'AxesConfig.log needs to be re-entrant',
        )
Ejemplo n.º 2
0
    def test_axes_config_log_re_entrant(self, log):
        """
        Test that log call count does not increase on repeat calls.
        """

        AppConfig.log()
        calls = log.info.call_count

        AppConfig.log()
        self.assertTrue(
            calls == log.info.call_count and calls > 0,
            'AxesConfig.log needs to be re-entrant',
        )
Ejemplo n.º 3
0
 def test_axes_config_log_user_ip(self, log):
     AppConfig.log()
     log.info.assert_called_with('AXES: blocking by combination of username and IP.')
Ejemplo n.º 4
0
 def test_axes_config_log_ip_only(self, log):
     AppConfig.log()
     log.info.assert_called_with('AXES: blocking by IP only.')
Ejemplo n.º 5
0
 def test_axes_config_log_not_verbose(self, log):
     AppConfig.log()
     self.assertFalse(log.info.called)
Ejemplo n.º 6
0
 def test_axes_config_log_user_ip(self, log):
     AppConfig.log()
     log.info.assert_called_with(
         'AXES: blocking by combination of username and IP.')
Ejemplo n.º 7
0
 def test_axes_config_log_ip_only(self, log):
     AppConfig.log()
     log.info.assert_called_with('AXES: blocking by IP only.')
Ejemplo n.º 8
0
 def test_axes_config_log_not_verbose(self, log):
     AppConfig.log()
     self.assertFalse(log.info.called)