Skip to content

Commit

Permalink
Adds special test strings for client testing
Browse files Browse the repository at this point in the history
Fixes #1080
We have many test strings for testing the client text formatting.
One can enable test data by:

`CLIENT_TEST_DATA=1 NUM_SOURCES=20 make dev`
  • Loading branch information
kushaldas committed Jun 9, 2020
1 parent 211a394 commit 9a75a52
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 22 deletions.
24 changes: 2 additions & 22 deletions securedrop/create-dev-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from sdconfig import config
from db import db
from models import Journalist, Reply, Source, Submission
from specialstrings import special_submissions

submissions = cycle([
'This is a test submission without markup!',
Expand All @@ -28,27 +29,6 @@
'<strong>This text should not be bold</strong>!'
])

spcial_submissions = cycle([
"""~!@#$%^&*()_+{}|:"<>?~!@#$%^&*()_+{}|:"<>?~!@#$%^&*()_+{}|:"<>?~!@#$%""",
"""Ω≈ç√∫˜µ≤≥÷
åß∂ƒ©˙∆˚¬…æ
œ∑´®†¥¨ˆøπ“‘
¡™£¢∞§¶•ªº–≠
¸˛Ç◊ı˜Â¯˘¿
ÅÍÎÏ˝ÓÔÒÚÆ☃
Œ„´‰ˇÁ¨ˆØ∏”""",
"""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$""" # noqa: W605, E501
"""............................................................................................................................ .""", # noqa: W605, E501

"""thisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwithoutspacesordashesthisisalongwordwit💩houtspacesordashes""", # noqa: W605, E501

"""😍😍😍😍🔥🔥🔥🔥🔥🖧Thelastwas3networkedcomuters📟📸longwordwit💩houtspacesordashes""" # noqa: W605, E501



]
)


def main(staging=False):
app = journalist_app.create_app(config)
Expand Down Expand Up @@ -136,7 +116,7 @@ def create_source_and_submissions(
for _ in range(num_submissions):
source.interaction_count += 1
if client_test_data:
submission_text = next(spcial_submissions)
submission_text = next(special_submissions)
else:
submission_text = next(submissions)
fpath = current_app.storage.save_message_submission(
Expand Down
87 changes: 87 additions & 0 deletions securedrop/specialstrings.py

Large diffs are not rendered by default.

0 comments on commit 9a75a52

Please sign in to comment.