mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
19 lines
490 B
Python
19 lines
490 B
Python
from unittest.mock import MagicMock
|
|
|
|
from axes.signals import user_locked_out
|
|
|
|
from tests.base import AxesTestCase
|
|
|
|
|
|
class SignalTestCase(AxesTestCase):
|
|
def test_send_lockout_signal(self):
|
|
"""
|
|
Test if the lockout signal is correctly emitted when user is locked out.
|
|
"""
|
|
|
|
handler = MagicMock()
|
|
user_locked_out.connect(handler)
|
|
|
|
self.assertEqual(0, handler.call_count)
|
|
self.lockout()
|
|
self.assertEqual(1, handler.call_count)
|