コード例 #1
0
 def check_error_codes(self, expected):
     errors = check_settings([])
     assert len(errors) == len(expected)
     assert all(isinstance(e, Error) for e in errors)
     assert [e.id for e in errors] == expected
コード例 #2
0
 def test_cors_preflight_max_age_negative(self):
     errors = check_settings([])
     assert len(errors) > 0
     assert isinstance(errors[0], checks.Error)
     assert errors[0].id == "corsheaders.E004"
コード例 #3
0
 def test_all_pass(self):
     errors = check_settings([])
     assert len(errors) == 0
コード例 #4
0
 def test_cors_replace_https_referer_failure(self):
     errors = check_settings([])
     assert len(errors) > 0
     assert isinstance(errors[0], checks.Error)
     assert errors[0].id == "corsheaders.E0011"
コード例 #5
0
 def test_cors_model_failure(self):
     errors = check_settings([])
     assert len(errors) > 0
     assert isinstance(errors[0], checks.Error)
     assert errors[0].id == "corsheaders.E0010"
コード例 #6
0
 def test_cors_origin_regex_whitelist_failure(self):
     errors = check_settings([])
     assert len(errors) > 0
     assert isinstance(errors[0], checks.Error)
     assert errors[0].id == "corsheaders.E007"
コード例 #7
0
 def test_cors_allow_credentials_failure(self):
     errors = check_settings([])
     assert len(errors) > 0
     assert isinstance(errors[0], checks.Error)
     assert errors[0].id == "corsheaders.E003"
コード例 #8
0
 def check_error_codes(self, expected):
     errors = check_settings([])
     assert len(errors) == len(expected)
     assert all(isinstance(e, Error) for e in errors)
     assert [e.id for e in errors] == expected