mirror of https://github.com/django/django.git
22 lines
468 B
Python
22 lines
468 B
Python
from django.utils import unittest
|
|
from django.utils._os import safe_join
|
|
|
|
|
|
class SafeJoinTests(unittest.TestCase):
|
|
def test_base_path_ends_with_sep(self):
|
|
self.assertEqual(
|
|
safe_join("/abc/", "abc"),
|
|
"/abc/abc",
|
|
)
|
|
|
|
def test_root_path(self):
|
|
self.assertEqual(
|
|
safe_join("/", "path"),
|
|
"/path",
|
|
)
|
|
|
|
self.assertEqual(
|
|
safe_join("/", ""),
|
|
"/",
|
|
)
|