Skip to content

Commit

Permalink
test: add test for the last item in hashtag array
Browse files Browse the repository at this point in the history
  • Loading branch information
azharcodeit committed Aug 4, 2024
1 parent 53a53b1 commit b260d03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/tests/test_projects_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_create_project(client, organisation, project_data):


@pytest.mark.parametrize(
"hashtag_input,expected_output",
"hashtag_input, expected_output",
[
("tag1, tag2, tag3", ["#tag1", "#tag2", "#tag3", "#fmtm"]),
("tag1 tag2 tag3", ["#tag1", "#tag2", "#tag3", "#fmtm"]),
Expand All @@ -87,8 +87,10 @@ def test_hashtags(client, organisation, project_data, hashtag_input, expected_ou
"""Test hashtag parsing."""
project_data["hashtags"] = hashtag_input
response_data = create_project(client, organisation.id, project_data)
project_id = response_data["id"]
assert "id" in response_data
assert response_data["hashtags"][:-1] == expected_output
assert response_data["hashtags"][-1] == f"#{settings.FMTM_DOMAIN}-{project_id}"


async def test_delete_project(client, admin_user, project):
Expand Down

0 comments on commit b260d03

Please sign in to comment.