forked from Github-Mirrors/canaille
refactor: Backend.install calls uniformization
This commit is contained in:
parent
ed73916fa7
commit
02c8f0b177
3 changed files with 3 additions and 3 deletions
|
@ -9,6 +9,7 @@ class BaseBackend:
|
|||
instance = None
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
BaseBackend.instance = self
|
||||
self.register_models()
|
||||
|
||||
|
@ -32,7 +33,7 @@ class BaseBackend:
|
|||
self.teardown()
|
||||
|
||||
@classmethod
|
||||
def install(self):
|
||||
def install(self, config, debug=False):
|
||||
"""
|
||||
This methods prepares the database to host canaille data.
|
||||
"""
|
||||
|
|
|
@ -52,7 +52,6 @@ def install_schema(config, schema_path):
|
|||
class Backend(BaseBackend):
|
||||
def __init__(self, config):
|
||||
super().__init__(config)
|
||||
self.config = config
|
||||
self.connection = None
|
||||
setup_ldap_models(config)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from canaille.backends import BaseBackend
|
|||
|
||||
def test_required_methods(testclient):
|
||||
with pytest.raises(NotImplementedError):
|
||||
BaseBackend.install()
|
||||
BaseBackend.install(config=None)
|
||||
|
||||
with pytest.raises(NotImplementedError):
|
||||
BaseBackend.validate({})
|
||||
|
|
Loading…
Reference in a new issue