🐛(backend) fix flaky test with search contact

Sometimes emails generated by faker in data field match search.
So it's necessary to create contacts with empty data field
to search contacts by full_name in tests.
This commit is contained in:
Sabrina Demagny
2025-01-17 19:40:05 +01:00
parent 4ccea4655b
commit defc18ea40
3 changed files with 5 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ and this project adheres to
### Fixed
- 🐛(backend) fix flaky test with search contact #605
- 🐛(backend) fix flaky test with team access #646
- 🧑‍💻(dimail) remove 'NoneType: None' log in debug mode
- 🐛(frontend) fix flaky e2e test #636

View File

@@ -25,8 +25,6 @@ from core.api import permissions
from core.api.client import serializers
from core.utils.raw_sql import gen_sql_filter_json_array
SIMILARITY_THRESHOLD = 0.04
class NestedGenericViewSet(viewsets.GenericViewSet):
"""

View File

@@ -102,10 +102,10 @@ def test_api_contacts_list_authenticated_by_full_name():
"""
user = factories.UserFactory(name="Prudence Crandall")
dave = factories.BaseContactFactory(full_name="David Bowman")
nicole = factories.BaseContactFactory(full_name="Nicole Foole")
frank = factories.BaseContactFactory(full_name="Frank Poole")
factories.BaseContactFactory(full_name="Heywood Floyd")
dave = factories.BaseContactFactory(full_name="David Bowman", data={})
nicole = factories.BaseContactFactory(full_name="Nicole Foole", data={})
frank = factories.BaseContactFactory(full_name="Frank Poole", data={})
factories.BaseContactFactory(full_name="Heywood Floyd", data={})
# Full query should work
client = APIClient()