mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Add test case
This commit is contained in:
		
							parent
							
								
									a1f257369d
								
							
						
					
					
						commit
						1d162dc769
					
				@ -1,5 +1,7 @@
 | 
				
			|||||||
from random import randint
 | 
					from random import randint
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.contrib.admin.models import LogEntry
 | 
				
			||||||
 | 
					from django.contrib.auth.models import User
 | 
				
			||||||
from django.test import TestCase, override_settings
 | 
					from django.test import TestCase, override_settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..models import Correspondent, Document, Tag
 | 
					from ..models import Correspondent, Document, Tag
 | 
				
			||||||
@ -208,6 +210,7 @@ class TestDocumentConsumptionFinishedSignal(TestCase):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def setUp(self):
 | 
					    def setUp(self):
 | 
				
			||||||
        TestCase.setUp(self)
 | 
					        TestCase.setUp(self)
 | 
				
			||||||
 | 
					        User.objects.create_user(username='testuser', password='12345')
 | 
				
			||||||
        self.doc_contains = Document.objects.create(
 | 
					        self.doc_contains = Document.objects.create(
 | 
				
			||||||
            content="I contain the keyword.", file_type="pdf")
 | 
					            content="I contain the keyword.", file_type="pdf")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -244,3 +247,9 @@ class TestDocumentConsumptionFinishedSignal(TestCase):
 | 
				
			|||||||
        document_consumption_finished.send(
 | 
					        document_consumption_finished.send(
 | 
				
			||||||
            sender=self.__class__, document=self.doc_contains)
 | 
					            sender=self.__class__, document=self.doc_contains)
 | 
				
			||||||
        self.assertEqual(self.doc_contains.correspondent, None)
 | 
					        self.assertEqual(self.doc_contains.correspondent, None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_logentry_created(self):
 | 
				
			||||||
 | 
					        document_consumption_finished.send(
 | 
				
			||||||
 | 
					            sender=self.__class__, document=self.doc_contains)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        self.assertEqual(LogEntry.objects.count(), 1)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user