diff options
| author | rr- | 2016-04-17 12:55:07 +0200 |
|---|---|---|
| committer | rr- | 2016-04-17 16:35:31 +0200 |
| commit | bc15fb6675174fd811ffbf91dc613acdf6b9c297 (patch) | |
| tree | 451b7aa19e3ffa1284103aad8aefb9d995f313e8 /server/szurubooru/tests/conftest.py | |
| parent | 9ac70dbed45bbbe76ef55717c2aa53aab0b3be24 (diff) | |
server/posts: add sketch of post table
Diffstat (limited to 'server/szurubooru/tests/conftest.py')
| -rw-r--r-- | server/szurubooru/tests/conftest.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/szurubooru/tests/conftest.py b/server/szurubooru/tests/conftest.py index e0d6785..239f5b6 100644 --- a/server/szurubooru/tests/conftest.py +++ b/server/szurubooru/tests/conftest.py @@ -71,3 +71,18 @@ def tag_factory(): tag.creation_time = datetime.datetime(1996, 1, 1) return tag return factory + +@pytest.fixture +def post_factory(): + def factory( + safety=db.Post.SAFETY_SAFE, + type=db.Post.TYPE_IMAGE, + checksum='...'): + post = db.Post() + post.safety = safety + post.type = type + post.checksum = checksum + post.flags = 0 + post.creation_time = datetime.datetime(1996, 1, 1) + return post + return factory |