mirror of
				https://github.com/django/django.git
				synced 2025-10-26 23:26:08 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			365 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			365 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from django.test import TestCase
 | |
| 
 | |
| from .models import Empty
 | |
| 
 | |
| 
 | |
| class EmptyModelTests(TestCase):
 | |
|     def test_empty(self):
 | |
|         m = Empty()
 | |
|         self.assertIsNone(m.id)
 | |
|         m.save()
 | |
|         Empty.objects.create()
 | |
|         self.assertEqual(len(Empty.objects.all()), 2)
 | |
|         self.assertIsNotNone(m.id)
 | |
|         existing = Empty(m.id)
 | |
|         existing.save()
 |