Skip to content

Commit

Permalink
revising test to check that uuids are string values
Browse files Browse the repository at this point in the history
  • Loading branch information
RuthShryock authored and noliveleger committed Jul 30, 2024
1 parent d6e5e98 commit 762fd9e
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions kobo/apps/subsequences/tests/test_submission_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,27 @@ def test_stream_with_extras_handles_duplicated_submission_uuids(self):
self.asset.deployment.mock_submissions(submissions)

# Process submissions with extras
try:
_ = list(
stream_with_extras(
self.asset.deployment.get_submissions(
user=self.asset.owner
),
self.asset,
)
output = list(
stream_with_extras(
self.asset.deployment.get_submissions(user=self.asset.owner),
self.asset,
)
except TypeError as e:
self.fail(f"TypeError occurred: {e}")
self.assertTrue(True)
)

# Make sure that uuid values for single or multiple choice qualitative
# analysis questions are kept as strings and not mutated
for submission in output:
supplemental_details = submission['_supplementalDetails']
for qual_response in supplemental_details['Tell_me_a_story']['qual']:
if qual_response['type'] not in [
'qual_select_one',
'qual_select_multiple',
]:
# question is not a single or multiple choice one
continue

for v in qual_response['val']:
assert isinstance(v['uuid'], str)

# Clear all mocked submissions to avoid duplicate submission errors
self.asset.deployment.mock_submissions([])

0 comments on commit 762fd9e

Please sign in to comment.