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

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

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

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

        AppConfig.initialize()
        self.assertTrue(
            calls == log.info.call_count and calls > 0,
            'AxesConfig.initialize needs to be re-entrant',
        )
Esempio n. 3
0
 def test_initialize(self):
     AppConfig.logging_initialized = False
     AppConfig.initialize()
     self.assertFalse(AppConfig.logging_initialized)
Esempio n. 4
0
 def test_axes_config_log_user_ip(self, log):
     AppConfig.initialize()
     log.info.assert_called_with(
         'AXES: blocking by combination of username and IP.')
Esempio n. 5
0
 def test_axes_config_log_ip_only(self, log):
     AppConfig.initialize()
     log.info.assert_called_with('AXES: blocking by IP only.')
Esempio n. 6
0
 def test_axes_config_log_not_verbose(self, log):
     AppConfig.initialize()
     self.assertFalse(log.info.called)
Esempio n. 7
0
 def test_axes_config_log_user_or_ip(self, log):
     AppConfig.initialize()
     log.info.assert_called_with("AXES: blocking by username or IP.")
Esempio n. 8
0
 def test_axes_config_log_user_ip(self, log):
     AppConfig.initialize()
     log.info.assert_called_with('AXES: blocking by combination of username and IP.')
Esempio n. 9
0
 def test_axes_config_log_ip_only(self, log):
     AppConfig.initialize()
     log.info.assert_called_with('AXES: blocking by IP only.')
Esempio n. 10
0
 def test_axes_config_log_not_verbose(self, log):
     AppConfig.initialize()
     self.assertFalse(log.info.called)