test_posting.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:issue-reporting 作者: 6aika 项目源码 文件源码
def test_default_moderation_status(mf_api_client, random_service, settings, status):
    """
    Test that when the default mod status is not 'public',
    freshly created issues are not visible via the list endpoint
    """
    settings.ISSUES_DEFAULT_MODERATION_STATUS = status
    posted_issues = get_data_from_response(
        mf_api_client.post(ISSUE_LIST_ENDPOINT, {
            "lat": 15,
            "long": 15,
            "description": get_random_string(),
            "service_code": random_service.service_code,
        }),
        201,
        schema=LIST_OF_ISSUES_SCHEMA
    )
    verify_issue(posted_issues[0])

    listed_issues = get_data_from_response(
        mf_api_client.get(ISSUE_LIST_ENDPOINT),
        200,
    )
    assert bool(listed_issues) == (status == 'public')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号