diff --git a/tests/db/test_init.py b/tests/db/test_init.py index f0dc5925ec370c5b3f6ea8d8b09995aacec303ca..8b2e840fa46a75ae46f2972d7700d2b2457720d0 100644 --- a/tests/db/test_init.py +++ b/tests/db/test_init.py @@ -23,7 +23,7 @@ class TestConfigureSessionFactory(TestCase): self.Session = sessionmaker() def test_session_is_not_bound_if_no_engine_is_defined_by_config(self): - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) session = self.Session() self.assertTrue(session.bind is None) session.close() @@ -33,7 +33,7 @@ class TestConfigureSessionFactory(TestCase): session = self.Session() self.assertTrue(session.bind is None) session.close() - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) session = self.Session() self.assertTrue(isinstance(session.bind, Engine)) self.assertEqual(unicode(session.bind.url), u'sqlite:////a/very/custom/db') @@ -55,14 +55,14 @@ class TestConfigureSessionFactory(TestCase): @patch(u'rattail.db.changes.record_changes') def test_changes_will_not_be_recorded_by_default(self, record_changes): self.config.set(u'rattail.db', u'sqlalchemy.url', u'sqlite://') - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) self.assertFalse(record_changes.called) @patch('rattail.db.util.record_changes') def test_changes_will_be_recorded_by_so_configured(self, record_changes): self.config.set(u'rattail.db', u'sqlalchemy.url', u'sqlite://') self.config.set(u'rattail.db', u'changes.record', u'true') - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) # Role changes are ignored by default. record_changes.assert_called_once_with(self.Session, True) @@ -70,7 +70,7 @@ class TestConfigureSessionFactory(TestCase): def test_changes_will_still_be_recorded_with_deprecated_config(self, record_changes): self.config.set(u'rattail.db', u'sqlalchemy.url', u'sqlite://') self.config.set(u'rattail.db', u'changes.record', u'true') - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) # Role changes are ignored by default. record_changes.assert_called_once_with(self.Session, True) @@ -79,6 +79,6 @@ class TestConfigureSessionFactory(TestCase): self.config.set(u'rattail.db', u'sqlalchemy.url', u'sqlite://') self.config.set(u'rattail.db', u'changes.record', u'true') self.config.set(u'rattail.db', u'changes.ignore_roles', u'false') - configure_session_factory(self.config, self.Session) + configure_session_factory(self.config, session_factory=self.Session) # Role changes are ignored by default; False means config works. record_changes.assert_called_once_with(self.Session, False)