summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-10-05 19:52:58 -0300
committerVictor Shyba <victor1984@riseup.net>2016-10-21 14:09:54 -0300
commit09a62dd1d6b076fcc7ac001d0b998ebb119feaad (patch)
tree0e5795aab017cd78e200e04a1a08f5ad1d800e9f
parent28eb55c8388fa0dd713471d1c3334ef4ccb49ae4 (diff)
[tests] make check_schema_versions default to False
CouchServerState is spread across test codebase and this option is intended to be used only on server startup. This commit makes it default to False and explicitly set it to True on where it's necessary.
-rw-r--r--common/src/leap/soledad/common/couch/state.py2
-rw-r--r--server/src/leap/soledad/server/__init__.py3
-rw-r--r--testing/tests/couch/test_state.py6
3 files changed, 7 insertions, 4 deletions
diff --git a/common/src/leap/soledad/common/couch/state.py b/common/src/leap/soledad/common/couch/state.py
index 1d045a9d..70c5fa36 100644
--- a/common/src/leap/soledad/common/couch/state.py
+++ b/common/src/leap/soledad/common/couch/state.py
@@ -66,7 +66,7 @@ class CouchServerState(ServerState):
TOKENS_USER_ID_KEY = "user_id"
def __init__(self, couch_url, create_cmd=None,
- check_schema_versions=True):
+ check_schema_versions=False):
"""
Initialize the couch server state.
diff --git a/server/src/leap/soledad/server/__init__.py b/server/src/leap/soledad/server/__init__.py
index 2e1a453a..e4fa4aa7 100644
--- a/server/src/leap/soledad/server/__init__.py
+++ b/server/src/leap/soledad/server/__init__.py
@@ -267,7 +267,8 @@ def _load_config():
def _get_couch_state():
conf = _load_config()
- state = CouchServerState(conf['couch_url'], create_cmd=conf['create_cmd'])
+ state = CouchServerState(conf['couch_url'], create_cmd=conf['create_cmd'],
+ check_schema_versions=True)
SoledadBackend.BATCH_SUPPORT = conf.get('batching', False)
return state
diff --git a/testing/tests/couch/test_state.py b/testing/tests/couch/test_state.py
index a53ba076..e293b5b8 100644
--- a/testing/tests/couch/test_state.py
+++ b/testing/tests/couch/test_state.py
@@ -14,10 +14,12 @@ def test_wrong_couch_version_raises(db):
db.database.create(
{'_id': CONFIG_DOC_ID, SCHEMA_VERSION_KEY: wrong_schema_version})
with pytest.raises(WrongCouchSchemaVersionError):
- CouchServerState(db.couch_url, create_cmd='/bin/echo')
+ CouchServerState(db.couch_url, create_cmd='/bin/echo',
+ check_schema_versions=True)
def test_missing_config_doc_raises(db):
db.database.create({})
with pytest.raises(MissingCouchConfigDocumentError):
- CouchServerState(db.couch_url, create_cmd='/bin/echo')
+ CouchServerState(db.couch_url, create_cmd='/bin/echo',
+ check_schema_versions=True)