Exemplo n.º 1
0
 def test_log_log_info(self):
     """Test that log_info convenience function logs if enabled."""
     
     with LogCapture() as l:
         event = log_info("label", "message", self.user, extra=self.extra)
         m = ('eventlog', 'INFO', "0000000000000001 label (user: johndoe) - message {'key2': 'value2', 'key': 'value'}")
         l.check(m)
         event = log_info("label", "message", self.user, extra=self.extra, django_log=False)
         l.check(m)
Exemplo n.º 2
0
 def test_convenience_log_info(self):
     """Test the log_info convenience function."""
     
     event = log_info("label", "message", self.user, extra=self.extra)
     self.assertTrue(event.id)
     self.assertEqual(event.label, "label")
     self.assertEqual(event.message, "message")
     self.assertEqual(event.user, self.user)
     self.assertEqual(event.extra, self.extra)
     self.assertEqual(event.level, logging.INFO)