mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/tests: fix sort:pool test indentation
This commit is contained in:
@ -866,43 +866,43 @@ def test_tumbleweed(
|
||||
verify_unpaged("-special:tumbleweed", [1, 2, 3])
|
||||
|
||||
|
||||
def test_sort_pool(
|
||||
post_factory, pool_factory, pool_category_factory, verify_unpaged
|
||||
):
|
||||
post1 = post_factory(id=1)
|
||||
post2 = post_factory(id=2)
|
||||
post3 = post_factory(id=3)
|
||||
post4 = post_factory(id=4)
|
||||
pool1 = pool_factory(
|
||||
id=1,
|
||||
names=["pool1"],
|
||||
description="desc",
|
||||
category=pool_category_factory("test-cat1"),
|
||||
)
|
||||
pool1.posts = [post1, post4, post3]
|
||||
pool2 = pool_factory(
|
||||
id=2,
|
||||
names=["pool2"],
|
||||
description="desc",
|
||||
category=pool_category_factory("test-cat2"),
|
||||
)
|
||||
pool2.posts = [post3, post4, post2]
|
||||
db.session.add_all(
|
||||
[
|
||||
post1,
|
||||
post2,
|
||||
post3,
|
||||
post4,
|
||||
pool1,
|
||||
pool2
|
||||
]
|
||||
)
|
||||
db.session.flush()
|
||||
verify_unpaged("pool:1 sort:pool", [1, 4, 3])
|
||||
verify_unpaged("pool:2 sort:pool", [3, 4, 2])
|
||||
verify_unpaged("pool:1 pool:2 sort:pool", [4, 3])
|
||||
verify_unpaged("pool:2 pool:1 sort:pool", [3, 4])
|
||||
verify_unpaged("sort:pool", [1, 2, 3, 4])
|
||||
def test_sort_pool(
|
||||
post_factory, pool_factory, pool_category_factory, verify_unpaged
|
||||
):
|
||||
post1 = post_factory(id=1)
|
||||
post2 = post_factory(id=2)
|
||||
post3 = post_factory(id=3)
|
||||
post4 = post_factory(id=4)
|
||||
pool1 = pool_factory(
|
||||
id=1,
|
||||
names=["pool1"],
|
||||
description="desc",
|
||||
category=pool_category_factory("test-cat1"),
|
||||
)
|
||||
pool1.posts = [post1, post4, post3]
|
||||
pool2 = pool_factory(
|
||||
id=2,
|
||||
names=["pool2"],
|
||||
description="desc",
|
||||
category=pool_category_factory("test-cat2"),
|
||||
)
|
||||
pool2.posts = [post3, post4, post2]
|
||||
db.session.add_all(
|
||||
[
|
||||
post1,
|
||||
post2,
|
||||
post3,
|
||||
post4,
|
||||
pool1,
|
||||
pool2
|
||||
]
|
||||
)
|
||||
db.session.flush()
|
||||
verify_unpaged("pool:1 sort:pool", [1, 4, 3])
|
||||
verify_unpaged("pool:2 sort:pool", [3, 4, 2])
|
||||
verify_unpaged("pool:1 pool:2 sort:pool", [4, 3])
|
||||
verify_unpaged("pool:2 pool:1 sort:pool", [3, 4])
|
||||
verify_unpaged("sort:pool", [1, 2, 3, 4])
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
Reference in New Issue
Block a user