I want to run one specific unit test from my app bank/tests.py in the pipeline but I keep getting errors, I believe I am missing something on the syntax here
This is my test:
class SettingsTestCase(TestCase):
def test_timezone_default(self):
target_timezone = 'Europe/Copenhagen'
self.assertEqual(target_timezone, settings.TIME_ZONE)
print("Test: Correct timezone")
This is how I call the test in the pipeline:
...
script:
- echo "Unit test...."
- python manage.py test bank/tests.py:SettingsTestCase.test_timezone_default
...
This is the error message when the pipeline fails:
RROR: bank/tests (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: bank/tests
Traceback (most recent call last):
File "/usr/local/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
ModuleNotFoundError: No module named 'bank/tests'
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Any suggestions?