Commit b94ed4e1 authored by Raphaël Hertzog's avatar Raphaël Hertzog

test: improve tests when BASE_DIR is /tmp/distro-tracker

Running the tests from a checkout in /tmp/distro-tracker can lead
to unexpected errors (see below), we're now checking with a trailing
slash to avoid being trapped by the common prefix.

FAIL: test_temp_dirs_outside_of_base_path (distro_tracker.test.tests.TempDirsOnTestCase)
Test that the settings no longer point inside the base path.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/distro-tracker/distro_tracker/test/tests.py", line 57, in test_temp_dirs_outside_of_base_path
    getattr(settings, name))
AssertionError: '/tmp/distro-tracker' unexpectedly found in '/tmp/distro-tracker-tests-gtnifjiw/static'
parent fdc1744a
......@@ -53,7 +53,7 @@ class TempDirsTests(object):
def test_temp_dirs_outside_of_base_path(self):
""" Test that the settings no longer point inside the base path. """
for name in self.get_settings_names():
self.assertNotIn(getattr(settings, 'BASE_DIR'),
self.assertNotIn(os.path.join(getattr(settings, 'BASE_DIR'), ''),
getattr(settings, name))
def test_temp_dirs_in_data_path(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment