Skip to content

Commit

Permalink
✅ Add test for model strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dankolbman committed Aug 6, 2020
1 parent faf2d40 commit fcba276
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import pytest
import uuid

from creator.studies.models import Study
from creator.files.models import File, Version, DownloadToken
from creator.projects.models import Project


@pytest.mark.parametrize(
"model,expected",
[
(Study, "SD_00000001"),
(File, "SF_00000001"),
(Version, "FV_00000001"),
(Project, "test/test"),
],
)
def test_str(model, expected):
""" Test string conversion functions """
obj = model(pk=expected)
assert str(obj) == expected

0 comments on commit fcba276

Please sign in to comment.