mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 17:49:27 +02:00
Founndations for real-time event serialization/subscription/broadcasting
This commit is contained in:
parent
fd7c1e5dd8
commit
dd5881f2c6
6 changed files with 127 additions and 0 deletions
|
@ -5,6 +5,7 @@ from django.core.cache import cache as django_cache
|
|||
from dynamic_preferences.registries import global_preferences_registry
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from funkwhale_api.activity import record
|
||||
from funkwhale_api.taskapp import celery
|
||||
|
||||
|
||||
|
@ -81,3 +82,28 @@ def superuser_client(db, factories, client):
|
|||
setattr(client, 'user', user)
|
||||
yield client
|
||||
delattr(client, 'user')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def activity_registry():
|
||||
r = record.registry
|
||||
state = list(record.registry.items())
|
||||
yield record.registry
|
||||
record.registry.clear()
|
||||
for key, value in state:
|
||||
record.registry[key] = value
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def activity_registry():
|
||||
r = record.registry
|
||||
state = list(record.registry.items())
|
||||
yield record.registry
|
||||
record.registry.clear()
|
||||
for key, value in state:
|
||||
record.registry[key] = value
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def activity_muted(activity_registry, mocker):
|
||||
yield mocker.patch.object(record, 'send')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue