Skip to content
Browse files

Fixed default value for SPLIT_DB_FAILOVER not being set.

  • Loading branch information...
1 parent 1ff64c5 commit f7baed2c565ffafa01b571b6c0981192664830bb @jpvanhal committed Mar 15, 2012
Showing with 25 additions and 0 deletions.
  1. +5 −0 CHANGES.rst
  2. +1 −0 flask_split/core.py
  3. +19 −0 tests/test_extension.py
View
5 CHANGES.rst
@@ -3,6 +3,11 @@ Changelog
Here you can see the full list of changes between each Flask-Split release.
+0.1.2 (2012-03-15)
+^^^^^^^^^^^^^^^^^^
+
+- Fixed default value for ``SPLIT_DB_FAILOVER`` not being set.
+
0.1.1 (2012-03-12)
^^^^^^^^^^^^^^^^^^
View
1 flask_split/core.py
@@ -28,6 +28,7 @@ def init_app(state):
app = state.app
app.config.setdefault('SPLIT_ALLOW_MULTIPLE_EXPERIMENTS', False)
+ app.config.setdefault('SPLIT_DB_FAILOVER', False)
app.config.setdefault('SPLIT_IGNORE_IP_ADDRESSES', [])
app.config.setdefault('SPLIT_ROBOT_REGEX', r"""
(?i)\b(
View
19 tests/test_extension.py
@@ -14,6 +14,25 @@
class TestExtension(TestCase):
+ def test_provides_defaults_for_settings(self):
+ assert self.app.config['SPLIT_IGNORE_IP_ADDRESSES'] == []
+ assert self.app.config['SPLIT_ROBOT_REGEX'].strip() == r"""
+ (?i)\b(
+ Baidu|
+ Gigabot|
+ Googlebot|
+ libwww-perl|
+ lwp-trivial|
+ msnbot|
+ SiteUptime|
+ Slurp|
+ WordPress|
+ ZIBB|
+ ZyBorg
+ )\b
+ """.strip()
+ assert self.app.config['SPLIT_DB_FAILOVER'] is False
+ assert self.app.config['SPLIT_ALLOW_MULTIPLE_EXPERIMENTS'] is False
def test_ab_test_assigns_random_alternative_to_a_new_user(self):
ab_test('link_color', 'blue', 'red')

0 comments on commit f7baed2

Please sign in to comment.
Something went wrong with that request. Please try again.