mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-31 10:37:12 -04:00 
			
		
		
		
	fix filenames
This commit is contained in:
		
							parent
							
								
									6d37ebf79e
								
							
						
					
					
						commit
						af8a6c3764
					
				| @ -251,7 +251,7 @@ class MailDocumentParser(DocumentParser): | |||||||
|         with open(css_file, "rb") as css_handle: |         with open(css_file, "rb") as css_handle: | ||||||
| 
 | 
 | ||||||
|             files = { |             files = { | ||||||
|                 "html": ("email_msg_template.html", self.mail_to_html(mail)), |                 "html": ("index.html", self.mail_to_html(mail)), | ||||||
|                 "css": ("output.css", css_handle), |                 "css": ("output.css", css_handle), | ||||||
|             } |             } | ||||||
|             headers = {} |             headers = {} | ||||||
| @ -296,7 +296,7 @@ class MailDocumentParser(DocumentParser): | |||||||
|             files.append((name_clean, BytesIO(a.payload))) |             files.append((name_clean, BytesIO(a.payload))) | ||||||
|             html_clean = html_clean.replace(name_cid, name_clean) |             html_clean = html_clean.replace(name_cid, name_clean) | ||||||
| 
 | 
 | ||||||
|         files.append(("email_msg_template.html", StringIO(html_clean))) |         files.append(("index.html", StringIO(html_clean))) | ||||||
| 
 | 
 | ||||||
|         return files |         return files | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -437,7 +437,7 @@ class TestParser(TestCase): | |||||||
|                 result = self.parser.transform_inline_html(html, attachments) |                 result = self.parser.transform_inline_html(html, attachments) | ||||||
| 
 | 
 | ||||||
|         resulting_html = result[-1][1].read() |         resulting_html = result[-1][1].read() | ||||||
|         self.assertTrue(result[-1][0] == "email_msg_template.html") |         self.assertTrue(result[-1][0] == "index.html") | ||||||
|         self.assertTrue(result[0][0] in resulting_html) |         self.assertTrue(result[0][0] in resulting_html) | ||||||
|         self.assertFalse("<script" in resulting_html.lower()) |         self.assertFalse("<script" in resulting_html.lower()) | ||||||
| 
 | 
 | ||||||
| @ -485,7 +485,7 @@ class TestParser(TestCase): | |||||||
|         mock_post.call_args.kwargs["files"]["cidpart1pNdUSz0sD3NqVtPgexamplede"][ |         mock_post.call_args.kwargs["files"]["cidpart1pNdUSz0sD3NqVtPgexamplede"][ | ||||||
|             1 |             1 | ||||||
|         ].read() |         ].read() | ||||||
|         mock_post.call_args.kwargs["files"]["email_msg_template.html"][1].read() |         mock_post.call_args.kwargs["files"]["index.html"][1].read() | ||||||
| 
 | 
 | ||||||
|         mock_response.raise_for_status.assert_called_once() |         mock_response.raise_for_status.assert_called_once() | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user