mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	feat: add tests for barcode scanner value checks
This commit is contained in:
		| @@ -176,3 +176,26 @@ class TestSettingsChecks(DirectoriesMixin, TestCase): | |||||||
|         msg = msgs[0] |         msg = msgs[0] | ||||||
|  |  | ||||||
|         self.assertIn('Timezone "TheMoon\\MyCrater"', msg.msg) |         self.assertIn('Timezone "TheMoon\\MyCrater"', msg.msg) | ||||||
|  |  | ||||||
|  |     @override_settings(CONSUMER_BARCODE_SCANNER="Invalid") | ||||||
|  |     def test_barcode_scanner_invalid(self): | ||||||
|  |         msgs = settings_values_check(None) | ||||||
|  |         self.assertEqual(len(msgs), 1) | ||||||
|  |  | ||||||
|  |         msg = msgs[0] | ||||||
|  |  | ||||||
|  |         self.assertIn('Invalid Barcode Scanner "Invalid"', msg.msg) | ||||||
|  |  | ||||||
|  |     @override_settings(CONSUMER_BARCODE_SCANNER="") | ||||||
|  |     def test_barcode_scanner_empty(self): | ||||||
|  |         msgs = settings_values_check(None) | ||||||
|  |         self.assertEqual(len(msgs), 1) | ||||||
|  |  | ||||||
|  |         msg = msgs[0] | ||||||
|  |  | ||||||
|  |         self.assertIn('Invalid Barcode Scanner ""', msg.msg) | ||||||
|  |  | ||||||
|  |     @override_settings(CONSUMER_BARCODE_SCANNER="PYZBAR") | ||||||
|  |     def test_barcode_scanner_valid(self): | ||||||
|  |         msgs = settings_values_check(None) | ||||||
|  |         self.assertEqual(len(msgs), 0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Marvin Gaube
					Marvin Gaube