Esempio n. 1
0
def test_report(topic, user):
    """Tests if the reports can be saved/edited and deleted with the
    implemented save and delete methods."""
    report = Report(reason="Test Report")
    report.save(user=user, post=topic.first_post)
    assert report.reason == "Test Report"

    report.reason = "Test Report Edited"
    report.save()
    assert report.reason == "Test Report Edited"

    report.delete()
    report = Report.query.filter_by(id=report.id).first()
    assert report is None
Esempio n. 2
0
def test_report(topic, user):
    """Tests if the reports can be saved/edited and deleted with the
    implemented save and delete methods."""
    report = Report(reason="Test Report")
    report.save(user=user, post=topic.first_post)
    assert report.reason == "Test Report"

    report.reason = "Test Report Edited"
    report.save()
    assert report.reason == "Test Report Edited"

    report.delete()
    report = Report.query.filter_by(id=report.id).first()
    assert report is None