Send confirmation emails on register and add button to resend email (#298)

* Fixes #293
* Adding get_config/set_config test
This commit is contained in:
Kevin Chung
2017-07-01 01:37:08 -04:00
committed by GitHub
parent f1e339c3dc
commit 95245d2ab5
3 changed files with 65 additions and 19 deletions

View File

@@ -3,10 +3,20 @@
from tests.helpers import *
from CTFd.models import ip2long, long2ip
from CTFd.utils import override_template
from CTFd.utils import get_config, set_config, override_template
import json
def test_get_config_and_set_config():
"""Does get_config and set_config work properly"""
app = create_ctfd()
with app.app_context():
assert get_config('setup') == True
config = set_config('TEST_CONFIG_ENTRY', 'test_config_entry')
assert config.value == 'test_config_entry'
assert get_config('TEST_CONFIG_ENTRY') == 'test_config_entry'
def test_ip2long_ipv4():
"""Does ip2long work properly for ipv4 addresses"""
assert ip2long('127.0.0.1') == 2130706433