mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Update test_adapter.py
This commit is contained in:
		| @@ -106,6 +106,27 @@ class TestCustomAccountAdapter(TestCase): | |||||||
|         self.assertTrue(user.groups.filter(name="group1").exists()) |         self.assertTrue(user.groups.filter(name="group1").exists()) | ||||||
|         self.assertFalse(user.groups.filter(name="group2").exists()) |         self.assertFalse(user.groups.filter(name="group2").exists()) | ||||||
|  |  | ||||||
|  |     def test_fresh_install_save_creates_superuser(self): | ||||||
|  |         adapter = get_adapter() | ||||||
|  |         form = mock.Mock( | ||||||
|  |             cleaned_data={ | ||||||
|  |                 "username": "testuser", | ||||||
|  |                 "email": "user@paperless-ngx.com", | ||||||
|  |             }, | ||||||
|  |         ) | ||||||
|  |         user = adapter.save_user(HttpRequest(), User(), form, commit=True) | ||||||
|  |         self.assertTrue(user.is_superuser) | ||||||
|  |  | ||||||
|  |         # Next time, it should not create a superuser | ||||||
|  |         form = mock.Mock( | ||||||
|  |             cleaned_data={ | ||||||
|  |                 "username": "testuser2", | ||||||
|  |                 "email": "user2@paperless-ngx.com", | ||||||
|  |             }, | ||||||
|  |         ) | ||||||
|  |         user2 = adapter.save_user(HttpRequest(), User(), form, commit=True) | ||||||
|  |         self.assertFalse(user2.is_superuser) | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestCustomSocialAccountAdapter(TestCase): | class TestCustomSocialAccountAdapter(TestCase): | ||||||
|     def test_is_open_for_signup(self): |     def test_is_open_for_signup(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon