server/test: fix tests after post flags became strings
This commit is contained in:
parent
8e1e6af232
commit
fdc52162d5
3 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,7 @@ def get_post_snapshot(post: model.Post) -> Dict[str, Any]:
|
||||||
'source': post.source,
|
'source': post.source,
|
||||||
'safety': post.safety,
|
'safety': post.safety,
|
||||||
'checksum': post.checksum,
|
'checksum': post.checksum,
|
||||||
'flags': sorted(post.flags.split(',')),
|
'flags': sorted([x for x in post.flags.split(',') if x]),
|
||||||
'featured': post.is_featured,
|
'featured': post.is_featured,
|
||||||
'tags': sorted([tag.first_name for tag in post.tags]),
|
'tags': sorted([tag.first_name for tag in post.tags]),
|
||||||
'relations': sorted([rel.post_id for rel in post.relations]),
|
'relations': sorted([rel.post_id for rel in post.relations]),
|
||||||
|
|
|
@ -202,7 +202,7 @@ def post_factory(skip_post_hashing):
|
||||||
post.safety = safety
|
post.safety = safety
|
||||||
post.type = type
|
post.type = type
|
||||||
post.checksum = checksum
|
post.checksum = checksum
|
||||||
post.flags = []
|
post.flags = ''
|
||||||
post.mime_type = 'application/octet-stream'
|
post.mime_type = 'application/octet-stream'
|
||||||
post.creation_time = datetime(1996, 1, 1)
|
post.creation_time = datetime(1996, 1, 1)
|
||||||
return post
|
return post
|
||||||
|
|
|
@ -112,7 +112,7 @@ def test_serialize_post(
|
||||||
post.user = user_factory(name='post author')
|
post.user = user_factory(name='post author')
|
||||||
post.canvas_width = 200
|
post.canvas_width = 200
|
||||||
post.canvas_height = 300
|
post.canvas_height = 300
|
||||||
post.flags = ['loop']
|
post.flags = 'loop'
|
||||||
db.session.add(post)
|
db.session.add(post)
|
||||||
|
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
|
@ -654,7 +654,7 @@ def test_update_post_notes_with_invalid_content(input):
|
||||||
def test_update_post_flags():
|
def test_update_post_flags():
|
||||||
post = model.Post()
|
post = model.Post()
|
||||||
posts.update_post_flags(post, ['loop'])
|
posts.update_post_flags(post, ['loop'])
|
||||||
assert post.flags == ['loop']
|
assert post.flags == 'loop'
|
||||||
|
|
||||||
|
|
||||||
def test_update_post_flags_with_invalid_content():
|
def test_update_post_flags_with_invalid_content():
|
||||||
|
|
Reference in a new issue