Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a couple of test failures on Windows.

  • Loading branch information...
commit 2e928583861bc35f1ea137cb6f3353867f160bdb 1 parent fcec904
@kmtracey kmtracey authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 tests/regressiontests/utils/os_utils.py
View
17 tests/regressiontests/utils/os_utils.py
@@ -1,21 +1,26 @@
+import os
+
from django.utils import unittest
from django.utils._os import safe_join
class SafeJoinTests(unittest.TestCase):
def test_base_path_ends_with_sep(self):
+ drive, path = os.path.splitdrive(safe_join("/abc/", "abc"))
self.assertEqual(
- safe_join("/abc/", "abc"),
- "/abc/abc",
+ path,
+ "{0}abc{0}abc".format(os.path.sep)
)
def test_root_path(self):
+ drive, path = os.path.splitdrive(safe_join("/", "path"))
self.assertEqual(
- safe_join("/", "path"),
- "/path",
+ path,
+ "{0}path".format(os.path.sep),
)
+ drive, path = os.path.splitdrive(safe_join("/", ""))
self.assertEqual(
- safe_join("/", ""),
- "/",
+ path,
+ os.path.sep,
)
Please sign in to comment.
Something went wrong with that request. Please try again.