Skip to content

Commit

Permalink
Overriding Django settings for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sammy-sandhu committed Oct 22, 2024
1 parent a240782 commit 9bb44fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/configurations/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
from rest_framework.test import APITestCase
from users.models import XDSUser

from django.test import override_settings


class TestSetUp(APITestCase):
"""Class with setup and teardown for tests in XDS"""

def setUp(self):
"""Function to set up necessary data for testing"""

settings_manager = override_settings(SECURE_SSL_REDIRECT=False)
settings_manager.enable()
self.addCleanup(settings_manager.disable)

# self.patcher = patch('users.models.email_verification')
# self.mock_email_verification = self.patcher.start()

Expand Down
6 changes: 6 additions & 0 deletions app/core/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
from openlxp_notifications.models import email
from rest_framework.test import APITestCase

from django.test import override_settings


class TestSetUp(APITestCase):
"""Class with setup and teardown for tests in XDS"""

def setUp(self):
"""Function to set up necessary data for testing"""

settings_manager = override_settings(SECURE_SSL_REDIRECT=False)
settings_manager.enable()
self.addCleanup(settings_manager.disable)

self.patcher = patch('core.signals.trigger_update')
self.mock_send_email = self.patcher.start()

Expand Down
6 changes: 6 additions & 0 deletions app/users/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
from rest_framework.test import APITestCase
from users.models import XDSUser

from django.test import override_settings


class TestSetUp(APITestCase):
"""Class with setup and teardown for tests in XDS"""

def setUp(self):
"""Function to set up necessary data for testing"""

settings_manager = override_settings(SECURE_SSL_REDIRECT=False)
settings_manager.enable()
self.addCleanup(settings_manager.disable)

# self.patcher = patch('users.models.email_verification')
# self.mock_email_verification = self.patcher.start()

Expand Down
6 changes: 6 additions & 0 deletions app/xds_api/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
from rest_framework.test import APITestCase
from users.models import XDSUser

from django.test import override_settings


class TestSetUp(APITestCase):
"""Class with setup and teardown for tests in XDS"""

def setUp(self):
"""Function to set up necessary data for testing"""

settings_manager = override_settings(SECURE_SSL_REDIRECT=False)
settings_manager.enable()
self.addCleanup(settings_manager.disable)

# self.patcher = patch('users.models.email_verification')
# self.mock_email_verification = self.patcher.start()

Expand Down

0 comments on commit 9bb44fd

Please sign in to comment.