def test_logging_of_aidant_conection(self): entry = Journal.log_connection(aidant=self.aidant_thierry) self.assertEqual(len(Journal.objects.all()), 3) self.assertEqual(entry.action, "connect_aidant") self.assertEqual( entry.initiator, "Thierry Martin - Commune de Vernon - [email protected]")
def log_connection_on_login(sender, user: Aidant, request, **kwargs): Journal.log_connection(user)
def on_login(sender, user, request, **kwargs): Journal.log_connection(user)