def setUp(self): Content.objects().delete() User.objects().delete() u = User(username="******", password="") u.save() c = Content(path="/test-path/", title="Test Content item", author=u, publish_date=datetime.now(), is_published=True) c.save()
def content_detail(path): path = "/%s/" % (path,) content = Content.objects(path=path).first() if content is None: abort(404) return render_template("content.html", content=content)