def test_deactivate_callback_masquerade(self): signals.deactivate_callback(sender=self, request=self.request_masquerade, user=self.user_3) audit_log_event = UnitTestAuditLogEvent.objects.get() self.assertEqual(audit_log_event.user_id, 3) 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, 'Deactivate by: [email protected] (2)')
def test_deactivate_callback_masquerade_no_audit_log(self): signals.deactivate_callback(sender=self, request=self.request_masquerade, user=self.user_3) self.assertEqual(0, UnitTestAuditLogEvent.objects.count())