def test_file_inside_media_url(self): with django_settings({ 'MEDIA_URL': '/test/', 'MEDIA_ROOT': '/testroot/' }): self.assertEqual(DjangoMediaLocator.locate('/test/file'), ['/testroot/file'])
def test_file_outside_media_url(self): with django_settings({'MEDIA_URL': '/nope'}): self.assertEqual(DjangoMediaLocator.locate('/test/file'), [])
def test_file_inside_media_url(self): with django_settings({'MEDIA_URL': '/test/', 'MEDIA_ROOT': '/testroot/'}): self.assertEqual(DjangoMediaLocator.locate('/test/file'), ['/testroot/file'])