Skip to content

Commit

Permalink
Improve code linting compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpatel24 committed Sep 19, 2024
1 parent 728d0d1 commit cc37b6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions kobo/apps/openrosa/apps/logger/tests/test_form_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def test_duplicate_submission_with_same_content_but_with_different_attachment(se
)
media_file_path2 = os.path.join(
os.path.dirname(__file__),
'../fixtures/tutorial/instances/tutorial_with_attachment/attachment_with_different_content',
'../fixtures/tutorial/instances/tutorial_with_attachment/'
'attachment_with_different_content',
'1335783522563.jpg',
)
initial_instance_count = Instance.objects.count()
Expand Down Expand Up @@ -336,7 +337,8 @@ def test_duplicate_submission_with_same_content_but_with_different_attachment(se
Attachment.objects.filter(instance=initial_instance).count(), 1
)

# Test duplicate submission with same attachment (different file name)
# Test duplicate submission with same attachment name but with
# different content
with open(media_file_path2, 'rb') as media_file2:
self._make_submission(xml_submission_file_path, media_file=media_file2)
self.assertEqual(self.response.status_code, 202)
Expand Down
6 changes: 3 additions & 3 deletions kobo/apps/openrosa/libs/tests/mixins/make_submission_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def _add_submission_uuid_to_submission_xml(self, path):

# Insert the meta element before the closing tag of the root element
xml_content = (
xml_content[:closing_tag_index] +
meta_element +
xml_content[closing_tag_index:]
xml_content[:closing_tag_index]
+ meta_element # noqa: W503
+ xml_content[closing_tag_index:] # noqa: W503
)

# Write the updated XML content to a temporary file and return the path
Expand Down
1 change: 0 additions & 1 deletion kobo/apps/openrosa/libs/utils/logger_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
from kobo.apps.openrosa.apps.logger.models import Attachment, Instance, XForm
from kobo.apps.openrosa.apps.logger.models.attachment import (
generate_attachment_filename,
hash_attachment_contents,
)
from kobo.apps.openrosa.apps.logger.models.instance import (
InstanceHistory,
Expand Down
4 changes: 2 additions & 2 deletions kpi/tests/api/v2/test_api_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,8 @@ def test_edit_submission_with_xml_missing_uuids(self):
assert submission_json['_id'] == submission['_id']
assert submission_xml_root.find('./find_this').text == 'hello!'
assert (
submission_xml_root.find('./meta/instanceID').text
== 'uuid:9710c729-00a5-41f1-b740-8dd618bb4a49'
submission_xml_root.find('./meta/instanceID').text == # noqa: W504
'uuid:9710c729-00a5-41f1-b740-8dd618bb4a49'
)
assert submission_xml_root.find('./formhub/uuid') is None

Expand Down

0 comments on commit cc37b6c

Please sign in to comment.