コード例 #1
0
 def test_multiple_creators(self):
     """No crash if multiple creators in history table"""
     log_action(self.request, self.obj, ADDITION)
     user2 = User.objects.create_superuser('test2', '*****@*****.**', 'booh2')
     self.request.user = user2
     log_action(self.request, self.obj, ADDITION)
     self.assertEqual(self.obj.creator, user2)
コード例 #2
0
 def test_multiple_creators(self):
     """No crash if multiple creators in history table"""
     log_action(self.request, self.obj, ADDITION)
     user2 = User.objects.create_superuser('test2', '*****@*****.**',
                                           'booh2')
     self.request.user = user2
     log_action(self.request, self.obj, ADDITION)
     self.assertEqual(self.obj.creator, user2)
コード例 #3
0
 def test_creator(self):
     log_action(self.request, self.obj, ADDITION)
     self.assertEqual(self.obj.creator, self.user)
コード例 #4
0
 def test_not_authenticated(self):
     self.request.user = AnonymousUser()
     log_action(self.request, self.obj, ADDITION)
     self.assertIsNone(self.obj.creator)
コード例 #5
0
 def test_creator(self):
     log_action(self.request, self.obj, ADDITION)
     self.assertEqual(self.obj.creator, self.user)
コード例 #6
0
 def test_action_history_not_enabled(self):
     app_settings["ACTION_HISTORY_ENABLED"] = False
     log_action(self.request, self.obj, ADDITION)
     self.assertIsNone(self.obj.creator)
     app_settings["ACTION_HISTORY_ENABLED"] = True