Skip to content

Commit

Permalink
Increase coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Mar 13, 2017
1 parent f343d9d commit 35775ba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_model/test_model_blogpost.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,19 @@ def test_blogpost_is_not_deleted_after_owner_deletion(self):
assert owner not in db.session
assert blogpost in db.session
assert blogpost.owner == None, blogpost.owner

@with_context
def test_blogpost_public_json(self):
"""Test BLOGPOST to public json works."""
self.configure_fixtures()
owner = User(
email_addr="john.doe2@example.com",
name="johndoe2",
fullname="John Doe2",
locale="en")
blogpost = Blogpost(title='title', body="body", project=self.project, owner=owner)
db.session.add(blogpost)
db.session.commit()

tmp = blogpost.to_public_json()
assert tmp.keys().sort() == Blogpost().public_attributes().sort()

0 comments on commit 35775ba

Please sign in to comment.