Пример #1
0
def test_recaptcha_disabled():
    recaptcha = GoogleReCaptcha(site_key="SITE_KEY",
                                secret_key="SECRET_KEY",
                                is_enabled=False)
    assert recaptcha.is_enabled == False
    assert recaptcha.get_code() == ""
    assert recaptcha.verify(response="None", remote_ip="0.0.0.0") == True
Пример #2
0
def test_recaptcha_disabled_flask():
    app.config.update({
        "RECAPTCHA_ENABLED": False
    })
    recaptcha = GoogleReCaptcha(app=app)
    assert recaptcha.is_enabled == False
    assert recaptcha.get_code() == ""
    assert recaptcha.verify(response="None", remote_ip="0.0.0.0") == True
Пример #3
0
RECAPTCHA_RTABINDEX = 10

client = MongoClient()

recaptcha = RecaptchaField()

try:
    secret = os.environ.get('SECRET')
    app.config[
        'MONGO_URI'] = "mongodb+srv://test:[email protected]/test?retryWrites=true&w=majority"

except:
    db_link = os.environ.get('MONGO_URI')
    secret = os.environ.get('SECRET')

recaptcha = GoogleReCaptcha(app=app)

# uploads_dir = os.path.join(app.instance_path,'uploads')
# os.makedirs(uploads_dir,0o777,exist_ok=True)

APP_URL = "https://snapchatportal.herokuapp.com/"

app.config['JWT_SECRET_KEY'] = os.environ.get('JWT_SECRET_KEY')
app.config['JWT_BLACKLIST_ENABLED'] = True
app.config['JWT_BLACKLIST_TOKEN_CHECKS'] = ['access', 'refresh']
# app.config['MONGO_URI'] = os.environ.get('MONGO_URI')
app.config['MONGO_DBNAME'] = os.environ.get('DB_NAME')
app.config['TESTING'] = False

mongo = PyMongo(app)
bcrypt = Bcrypt(app)
Пример #4
0
def test_recaptcha_enabled_flask():
    recaptcha = GoogleReCaptcha(app=app)
    assert isinstance(recaptcha, GoogleReCaptcha)
    assert recaptcha.is_enabled == True
    assert "script" in recaptcha.get_code()
    assert recaptcha.verify(response="None", remote_ip="0.0.0.0") == False
Пример #5
0
def test_recaptcha_enabled():
    recaptcha = GoogleReCaptcha(site_key="SITE_KEY", secret_key="SECRET_KEY")
    assert isinstance(recaptcha, GoogleReCaptcha)
    assert recaptcha.is_enabled == True
    assert "script" in recaptcha.get_code()
    assert recaptcha.verify(response="None", remote_ip="0.0.0.0") == False