from django.conf import settings


def pytest_runtest_setup(item):
    settings.INSTALLED_APPS = [app for app in settings.INSTALLED_APPS if "shuup.front" not in app]

from django.conf import settings


ORIGINAL_SETTINGS = []


def pytest_runtest_setup(item):
    global ORIGINAL_SETTINGS
    ORIGINAL_SETTINGS = [item for item in settings.INSTALLED_APPS]
    settings.INSTALLED_APPS = [app for app in settings.INSTALLED_APPS if "shuup.front" not in app]


def pytest_runtest_teardown(item):
    settings.INSTALLED_APPS = [item for item in ORIGINAL_SETTINGS]

Fix unit test by adding back front apps after API tests
Fix unit test by adding back front apps after API tests

  from django.conf import settings
  
  
+ ORIGINAL_SETTINGS = []
+ 
+ 
  def pytest_runtest_setup(item):
+     global ORIGINAL_SETTINGS
+     ORIGINAL_SETTINGS = [item for item in settings.INSTALLED_APPS]
      settings.INSTALLED_APPS = [app for app in settings.INSTALLED_APPS if "shuup.front" not in app]
  
+ 
+ def pytest_runtest_teardown(item):
+     settings.INSTALLED_APPS = [item for item in ORIGINAL_SETTINGS]
+ 
Fix unit test by adding back front apps after API tests
## Code Before:
from django.conf import settings


def pytest_runtest_setup(item):
    settings.INSTALLED_APPS = [app for app in settings.INSTALLED_APPS if "shuup.front" not in app]

## Instruction:
Fix unit test by adding back front apps after API tests
## Code After:
from django.conf import settings


ORIGINAL_SETTINGS = []


def pytest_runtest_setup(item):
    global ORIGINAL_SETTINGS
    ORIGINAL_SETTINGS = [item for item in settings.INSTALLED_APPS]
    settings.INSTALLED_APPS = [app for app in settings.INSTALLED_APPS if "shuup.front" not in app]


def pytest_runtest_teardown(item):
    settings.INSTALLED_APPS = [item for item in ORIGINAL_SETTINGS]
