mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-10-07 22:38:24 -04:00
Fix UPSERTs on SQLite 3.24+ (#4477)
This commit is contained in:
parent
88f4df85ca
commit
7072fe3084
8 changed files with 30 additions and 18 deletions
|
@ -49,14 +49,17 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
self.db_pool.runWithConnection = runWithConnection
|
||||
|
||||
config = Mock()
|
||||
config._enable_native_upserts = False
|
||||
config._disable_native_upserts = True
|
||||
config.event_cache_size = 1
|
||||
config.database_config = {"name": "sqlite3"}
|
||||
engine = create_engine(config.database_config)
|
||||
fake_engine = Mock(wraps=engine)
|
||||
fake_engine.can_native_upsert = False
|
||||
hs = TestHomeServer(
|
||||
"test",
|
||||
db_pool=self.db_pool,
|
||||
config=config,
|
||||
database_engine=create_engine(config.database_config),
|
||||
database_engine=fake_engine,
|
||||
)
|
||||
|
||||
self.datastore = SQLBaseStore(None, hs)
|
||||
|
|
|
@ -18,12 +18,12 @@ from twisted.internet import defer
|
|||
|
||||
from synapse.api.constants import UserTypes
|
||||
|
||||
from tests.unittest import HomeserverTestCase
|
||||
from tests import unittest
|
||||
|
||||
FORTY_DAYS = 40 * 24 * 60 * 60
|
||||
|
||||
|
||||
class MonthlyActiveUsersTestCase(HomeserverTestCase):
|
||||
class MonthlyActiveUsersTestCase(unittest.HomeserverTestCase):
|
||||
def make_homeserver(self, reactor, clock):
|
||||
|
||||
hs = self.setup_test_homeserver()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue