79592427

Date: 2025-04-25 11:37:35
Score: 0.5
Natty:
Report link

I finally managed to get it.

At the beginning of my test file:

import sys


class FakeGlobalConfig:
    def __init__(self):
        self.ProjectName = ""


class FakeSettings:
    def __init__(self):
        self.global_config = FakeGlobalConfig()


import project.Settings

sys.modules["project.Settings"].Settings = FakeSettings

That's been placed at the very beginning, before anything else.

With that, we override the real `Settings` class and set the attributes we need.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Trauma