File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
from unittest .mock import patch
4
4
5
5
import pytest
6
+ from django .db .models .signals import post_save
6
7
8
+ from sde_collections .models .collection import create_configs_on_status_change
7
9
from sde_collections .models .delta_url import DeltaUrl , DumpUrl
8
10
from sde_collections .tasks import fetch_and_replace_full_text
9
11
from sde_collections .tests .factories import CollectionFactory
10
12
11
13
14
+ @pytest .fixture
15
+ def disconnect_signals ():
16
+ # Disconnect the signal before each test
17
+ post_save .disconnect (create_configs_on_status_change , sender = "sde_collections.Collection" )
18
+ yield
19
+ # Reconnect the signal after each test
20
+ post_save .connect (create_configs_on_status_change , sender = "sde_collections.Collection" )
21
+
22
+
12
23
@pytest .mark .django_db
13
- def test_fetch_and_replace_full_text ():
24
+ def test_fetch_and_replace_full_text (disconnect_signals ):
14
25
collection = CollectionFactory (config_folder = "test_folder" )
15
26
16
27
mock_batch = [
@@ -31,7 +42,7 @@ def mock_generator():
31
42
32
43
33
44
@pytest .mark .django_db
34
- def test_fetch_and_replace_full_text_large_dataset ():
45
+ def test_fetch_and_replace_full_text_large_dataset (disconnect_signals ):
35
46
"""Test processing a large number of records with proper pagination and batching."""
36
47
collection = CollectionFactory (config_folder = "test_folder" )
37
48
You can’t perform that action at this time.
0 commit comments