mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 09:07:18 +01:00
Fix: Coerce language app config field to None if empty
This commit is contained in:
parent
1ac298f6ff
commit
b0aeec4c43
2 changed files with 7 additions and 2 deletions
|
|
@ -76,10 +76,10 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
|
|||
config = ApplicationConfiguration.objects.first()
|
||||
self.assertEqual(config.color_conversion_strategy, ColorConvertChoices.RGB)
|
||||
|
||||
def test_api_update_config_empty_json_field(self):
|
||||
def test_api_update_config_empty_fields(self):
|
||||
"""
|
||||
GIVEN:
|
||||
- API request to update app config with empty string for user_args JSONField
|
||||
- API request to update app config with empty string for user_args JSONField and language field
|
||||
WHEN:
|
||||
- API is called
|
||||
THEN:
|
||||
|
|
@ -91,6 +91,7 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
|
|||
json.dumps(
|
||||
{
|
||||
"user_args": "",
|
||||
"language": "",
|
||||
},
|
||||
),
|
||||
content_type="application/json",
|
||||
|
|
@ -98,3 +99,4 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
|
|||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
config = ApplicationConfiguration.objects.first()
|
||||
self.assertEqual(config.user_args, None)
|
||||
self.assertEqual(config.language, None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue