Beispiel #1
0
 def when_get_reviews_should_return_a_list_of_reviews(self, app):
     deactivate_logger('info')
     create_users()
     create_roles()
     create_contents()
     create_reviews()
     result = TestClient(app.test_client()) \
         .with_auth(email=get_sandbox_role_email('editor')) \
         .get('/reviews')
     assert result.status_code == 200
     reviews = result.json
     assert len(reviews) == 3
        def when_get_contents_should_return_a_list_of_contents(self, app):
            # given
            deactivate_logger('info')
            create_users()
            create_contents()
            auth_request = TestClient(app.test_client())\
                             .with_auth(email=get_sandbox_role_email('master'))

            # when
            result = auth_request.get('/contents')

            # then
            assert result.status_code == 200
            contents = result.json
            assert len(contents) == 6
        def when_get_articles_should_return_a_list_of_articles_filter_by_keywords(
                self, app):
            # given
            deactivate_logger('info')
            create_users()
            create_articles()
            auth_request = TestClient(app.test_client())\
                             .with_auth(email=get_sandbox_role_email('master'))

            # when
            result = auth_request.get('/articles?keywords=Barrier')

            # then
            assert result.status_code == 200
            articles = result.json
            assert len(articles) == 1
Beispiel #4
0
def when_ci_sandbox_created_all_the_ci_objects(app):
    deactivate_logger('info')
    create_sandbox('ci')
    assert_created_counts(
        Article=6,
        ArticleTag=5,
        Evaluation=11,
        Publication=0,
        Review=3,
        ReviewTag=3,
        Role=30,
        Scope=43,
        User=21,
        UserArticle=0,
        UserPublication=0,
        UserSession=0,
        UserTag=2,
        Verdict=1,
        VerdictTag=1,
        VerdictUser=1,
    )
def when_ci_sandbox_created_all_the_ci_objects(app):
    deactivate_logger('info')
    create_sandbox('ci')
    assert_created_counts(
        Article=6,
        ArticleTag=5,
        AuthorArticle=0,
        AuthorContent=0,
        Evaluation=11,
        Publication=0,
        Review=3,
        ReviewerPublication=0,
        ReviewTag=3,
        Role=36,
        Scope=41,
        Content=6,
        ContentTag=5,
        User=24,
        UserSession=0,
        UserTag=2,
        Verdict=1,
        VerdictTag=1,
        VerdictReviewer=1,
    )