Skip to content

Commit

Permalink
update tests to include seen_by field
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed Oct 28, 2020
1 parent 0efb7a1 commit 4de4099
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def RemoteSource(**attrs):
submissions_url="wibble",
url="url",
uuid=str(uuid.uuid4()),
seen_by=None,
)

defaults.update(attrs)
Expand Down
5 changes: 1 addition & 4 deletions tests/migrations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ def add_user(session: Session, uuid: Optional[str] = None) -> None:
else:
journalist_uuid = uuid

params = {
"uuid": journalist_uuid,
"username": random_username(),
}
params = {"uuid": journalist_uuid, "username": random_username()}
sql = """
INSERT INTO users (uuid, username)
VALUES (:uuid, :username)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def make_remote_message(source_uuid, file_counter=1):
source_url=source_url,
submission_url="test",
uuid=str(uuid.uuid4()),
seen_by=None,
)


Expand All @@ -80,6 +81,7 @@ def make_remote_submission(source_uuid):
source_url=source_url,
submission_url="test",
uuid=str(uuid.uuid4()),
seen_by=None,
)


Expand All @@ -102,6 +104,7 @@ def make_remote_reply(source_uuid, journalist_uuid="testymctestface"):
size=1234,
source_url=source_url,
uuid=str(uuid.uuid4()),
seen_by=None,
)


Expand Down Expand Up @@ -757,6 +760,7 @@ def test_update_replies(homedir, mocker, session):
source_url="/api/v1/sources/{}".format(source.uuid),
file_counter=local_reply_update.file_counter,
filename=local_reply_update.filename,
seen_by=None,
)

remote_reply_create = factory.RemoteReply(
Expand All @@ -766,6 +770,7 @@ def test_update_replies(homedir, mocker, session):
filename="{}-filename.gpg".format(factory.REPLY_COUNT + 1),
journalist_first_name="",
journalist_last_name="",
seen_by=None,
)

remote_replies = [remote_reply_update, remote_reply_create]
Expand Down

0 comments on commit 4de4099

Please sign in to comment.