@@ -45,25 +45,13 @@ def test_lowercases_username(self):
45
45
46
46
47
47
@pytest .mark .slowtest
48
- def test_creates_django_project_in_virtualenv_with_hacked_settings_and_static_files (
49
- self , fake_home , virtualenvs_folder , api_responses , api_token
48
+ def test_actually_creates_django_project_in_virtualenv_with_hacked_settings_and_static_files (
49
+ self , fake_home , virtualenvs_folder , api_token
50
50
):
51
51
52
- webapps_url = API_ENDPOINT .format (username = getpass .getuser ())
53
- webapp_url = API_ENDPOINT .format (username = getpass .getuser ()) + 'mydomain.com/'
54
- reload_url = webapp_url + 'reload/'
55
- static_url = API_ENDPOINT .format (username = getpass .getuser ()) + 'mydomain.com/static_files/'
56
-
57
- api_responses .add (responses .GET , webapp_url , status = 404 )
58
- api_responses .add (responses .POST , webapps_url , status = 201 , body = json .dumps ({'status' : 'OK' }))
59
- api_responses .add (responses .PATCH , webapp_url , status = 200 )
60
- api_responses .add (responses .POST , reload_url , status = 200 , body = json .dumps ({'status' : 'OK' }))
61
- api_responses .add (responses .POST , static_url , status = 201 )
62
- api_responses .add (responses .POST , static_url , status = 201 )
63
-
64
-
65
52
with patch ('scripts.pa_start_django_webapp_with_virtualenv.DjangoProject.update_wsgi_file' ):
66
- main ('mydomain.com' , '1.9.2' , '2.7' , nuke = False )
53
+ with patch ('pythonanywhere.api.call_api' ):
54
+ main ('mydomain.com' , '1.9.2' , '2.7' , nuke = False )
67
55
68
56
django_version = subprocess .check_output ([
69
57
virtualenvs_folder / 'mydomain.com/bin/python' ,
@@ -82,27 +70,13 @@ def test_creates_django_project_in_virtualenv_with_hacked_settings_and_static_fi
82
70
83
71
@pytest .mark .slowtest
84
72
def test_nuke_option_lets_you_run_twice (
85
- self , fake_home , virtualenvs_folder , api_responses , api_token
73
+ self , fake_home , virtualenvs_folder , api_token
86
74
):
87
75
88
- webapps_url = API_ENDPOINT .format (username = getpass .getuser ())
89
- webapp_url = API_ENDPOINT .format (username = getpass .getuser ()) + 'mydomain.com/'
90
- reload_url = webapp_url + 'reload/'
91
- static_files_url = webapp_url + 'static_files/'
92
-
93
- api_responses .add (responses .GET , webapp_url , status = 404 )
94
- api_responses .add (responses .POST , webapps_url , status = 201 , body = json .dumps ({'status' : 'OK' }))
95
- api_responses .add (responses .PATCH , webapp_url , status = 200 )
96
- api_responses .add (responses .POST , reload_url , status = 200 , body = json .dumps ({'status' : 'OK' }))
97
- api_responses .add (responses .POST , static_files_url , status = 201 )
98
- api_responses .add (responses .POST , static_files_url , status = 201 )
99
-
100
76
with patch ('scripts.pa_start_django_webapp_with_virtualenv.DjangoProject.update_wsgi_file' ):
101
- main ('mydomain.com' , '1.9.2' , '2.7' , nuke = False )
102
-
103
- api_responses .add (responses .DELETE , webapp_url , status = 200 )
104
-
105
- main ('mydomain.com' , '1.11.3' , '3.6' , nuke = True )
77
+ with patch ('pythonanywhere.api.call_api' ):
78
+ main ('mydomain.com' , '1.9.2' , '2.7' , nuke = False )
79
+ main ('mydomain.com' , '1.11.3' , '3.6' , nuke = True )
106
80
107
81
django_version = subprocess .check_output ([
108
82
virtualenvs_folder / 'mydomain.com/bin/python' ,
0 commit comments