mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Completed test coverage for admin's LogEntry model.
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							fda55c71a8
						
					
				
				
					commit
					0b9ccf9e60
				
			| @@ -67,6 +67,11 @@ class LogEntryTests(TestCase): | ||||
|         with translation.override('fr'): | ||||
|             self.assertEqual(logentry.get_change_message(), 'Ajout.') | ||||
|  | ||||
|     def test_logentry_change_message_not_json(self): | ||||
|         """LogEntry.change_message was a string before Django 1.10.""" | ||||
|         logentry = LogEntry(change_message='non-JSON string') | ||||
|         self.assertEqual(logentry.get_change_message(), logentry.change_message) | ||||
|  | ||||
|     @override_settings(USE_L10N=True) | ||||
|     def test_logentry_change_message_localized_datetime_input(self): | ||||
|         """ | ||||
| @@ -177,6 +182,10 @@ class LogEntryTests(TestCase): | ||||
|         log_entry.action_flag = 4 | ||||
|         self.assertEqual(str(log_entry), 'LogEntry Object') | ||||
|  | ||||
|     def test_logentry_repr(self): | ||||
|         logentry = LogEntry.objects.first() | ||||
|         self.assertEqual(repr(logentry), str(logentry.action_time)) | ||||
|  | ||||
|     def test_log_action(self): | ||||
|         content_type_pk = ContentType.objects.get_for_model(Article).pk | ||||
|         log_entry = LogEntry.objects.log_action( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user