From 9adf3bdc50d9f67b65f49df9f704730b2c9ac1c9 Mon Sep 17 00:00:00 2001
From: Tzu-ping Chung <uranusjr@gmail.com>
Date: Wed, 4 Jul 2018 22:40:38 +0800
Subject: [PATCH] Fix casing test on Windows

---
 tests/integration/test_windows.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/integration/test_windows.py b/tests/integration/test_windows.py
index bd6eaf1911..128a6b5d04 100644
--- a/tests/integration/test_windows.py
+++ b/tests/integration/test_windows.py
@@ -18,7 +18,12 @@ def test_case_changes_windows(PipenvInstance, pypi):
         c = p.pipenv('install pytz')
         assert c.return_code == 0
 
-        virtualenv_location = Project().virtualenv_location
+        # Canonical venv location.
+        c = p.pipenv('--venv')
+        assert c.return_code == 0
+        virtualenv_location = c.out.strip()
+
+        # Dance around to change the casing of the project directory.
         target = p.path.upper()
         if target == p.path:
             target = p.path.lower()
@@ -26,8 +31,10 @@ def test_case_changes_windows(PipenvInstance, pypi):
         os.chdir(target)
         assert os.path.abspath(os.curdir) != p.path
 
-        venv = p.pipenv('--venv').out
-        assert venv.strip().lower() == virtualenv_location.lower()
+        # Ensure the incorrectly-cased project can find the correct venv.
+        c = p.pipenv('--venv')
+        assert c.return_code == 0
+        assert c.out.strip().lower() == virtualenv_location.lower()
 
 
 @pytest.mark.files