2018-10-28 21:27:49 +03:00
|
|
|
import pytest
|
|
|
|
from validate import check_query_f
|
2019-11-29 08:14:26 +03:00
|
|
|
from context import PytestConf
|
2018-10-28 21:27:49 +03:00
|
|
|
|
2019-11-29 08:14:26 +03:00
|
|
|
if not PytestConf.config.getoption("--test-webhook-insecure"):
|
2018-10-28 21:27:49 +03:00
|
|
|
pytest.skip("--test-webhook-https-insecure flag is missing, skipping tests", allow_module_level=True)
|
|
|
|
|
2020-02-13 12:14:02 +03:00
|
|
|
@pytest.mark.usefixtures('per_class_tests_db_state')
|
|
|
|
class TestHTTPSWebhookInsecure:
|
2018-10-28 21:27:49 +03:00
|
|
|
|
|
|
|
def test_user_select_unpublished_articles_err(self, hge_ctx):
|
|
|
|
check_query_f(hge_ctx, self.dir() + '/user_select_query_unpublished_articles_fail.yaml')
|
|
|
|
|
|
|
|
def test_user_only_other_users_published_articles_err(self, hge_ctx):
|
|
|
|
check_query_f(hge_ctx, self.dir() + '/user_query_other_users_published_articles_fail.yaml')
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def dir(cls):
|
|
|
|
return 'webhook/insecure'
|