mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	basic python tests
This commit is contained in:
		| @@ -22,6 +22,7 @@ from documents.models import DocumentType | |||||||
| from documents.models import MatchingModel | from documents.models import MatchingModel | ||||||
| from documents.models import SavedView | from documents.models import SavedView | ||||||
| from documents.models import Tag | from documents.models import Tag | ||||||
|  | from documents.models import UiSettings | ||||||
| from documents.tests.utils import DirectoriesMixin | from documents.tests.utils import DirectoriesMixin | ||||||
| from paperless import version | from paperless import version | ||||||
| from rest_framework.test import APITestCase | from rest_framework.test import APITestCase | ||||||
| @@ -1365,6 +1366,27 @@ class TestDocumentApiV2(DirectoriesMixin, APITestCase): | |||||||
|             "#000000", |             "#000000", | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  |     def test_ui_settings(self): | ||||||
|  |         test_user = User.objects.create_superuser(username="test") | ||||||
|  |         self.client.force_login(user=test_user) | ||||||
|  |  | ||||||
|  |         response = self.client.get(f"/api/ui_settings/", format="json") | ||||||
|  |         self.assertEqual(response.status_code, 200) | ||||||
|  |         self.assertEqual( | ||||||
|  |             response.data["settings"], | ||||||
|  |             [], | ||||||
|  |         ) | ||||||
|  |  | ||||||
|  |         UiSettings.objects.create( | ||||||
|  |             user=test_user, | ||||||
|  |             settings='{"dark_mode":[{"enabled":"true"}]}', | ||||||
|  |         ) | ||||||
|  |         response = self.client.get(f"/api/ui_settings/", format="json") | ||||||
|  |         self.assertNotEqual( | ||||||
|  |             response.data["settings"], | ||||||
|  |             [], | ||||||
|  |         ) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestBulkEdit(DirectoriesMixin, APITestCase): | class TestBulkEdit(DirectoriesMixin, APITestCase): | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon