コード例 #1
0
 def test_log_audit_event(self):
     signals.log_audit_event(message='Test', request=self.request, user=self.user_1)
     audit_log_event = UnitTestAuditLogEvent.objects.get()
     self.assertEqual(audit_log_event.user_id, 1)
     self.assertEqual(audit_log_event.user_email, '*****@*****.**')
     self.assertEqual(audit_log_event.company_id, 1)
     self.assertEqual(audit_log_event.masquerading_user_id, None)
     self.assertEqual(audit_log_event.masquerading_user_email, '')
     self.assertEqual(audit_log_event.message, 'Test')
コード例 #2
0
 def test_log_audit_event_masquerade_no_audit_log(self):
     signals.log_audit_event(message='Test', request=self.request_masquerade, user=self.user_2)
     self.assertEqual(0, UnitTestAuditLogEvent.objects.count())