def test_logout_callback_masquerade(self): signals.logout_callback(sender=self, request=self.request_masquerade, user=self.user_2) audit_log_event = UnitTestAuditLogEvent.objects.get() self.assertEqual(audit_log_event.user_id, 2) self.assertEqual(audit_log_event.user_email, '*****@*****.**') self.assertEqual(audit_log_event.company_id, 1) self.assertEqual(audit_log_event.masquerading_user_id, 1) self.assertEqual(audit_log_event.masquerading_user_email, '*****@*****.**') self.assertEqual(audit_log_event.message, 'Sign out')
def test_logout_callback_masquerade_no_audit_log(self): signals.logout_callback(sender=self, request=self.request_masquerade, user=self.user_2) self.assertEqual(0, UnitTestAuditLogEvent.objects.count())