@@ -21,16 +21,15 @@ def setUp(self):
21
21
)
22
22
23
23
self .pip_latest_url = url_base .format (version = '/en/latest/' )
24
+ self .pip_latest_url_index = url_base .format (version = '/en/latest/index.html' )
24
25
self .pip_latest_fr_url = url_base .format (version = '/fr/latest/' )
25
26
self .pip_abc_url = url_base .format (version = '/en/abc/' )
27
+ self .pip_abc_url_index = url_base .format (version = '/en/abc/index.html' )
26
28
self .pip_abc_fr_url = url_base .format (version = '/fr/abc/' )
27
- self .pip_abc_xyz_page_url = url_base .format (version = '/en/abc/xyz.html' )
28
- self .pip_abc_xyz_fr_page_url = url_base .format (version = '/fr/abc/xyz.html' )
29
- self .pip_abc_xyz_dir_url = url_base .format (version = '/en/abc/xyz/' )
30
- self .pip_abc_xyz_fr_dir_url = url_base .format (version = '/fr/abc/xyz/' )
31
- self .pip_abc_xyz_document = url_base .format (version = '/en/abc/index.html#document-xyz' )
32
- self .pip_abc_xyz_fr_document = url_base .format (version = '/fr/abc/index.html#document-xyz' )
33
- self .pip_latest_document_url = url_base .format (version = '/en/latest/document/' )
29
+ self .pip_abc_fr_url_index = url_base .format (version = '/fr/abc/index.html' )
30
+ self .pip_abc_xyz_page_url = url_base .format (version = '/en/abc/xyz' )
31
+ self .pip_abc_xyz_fr_page_url = url_base .format (version = '/fr/abc/xyz' )
32
+ self .pip_latest_document_url = url_base .format (version = '/en/latest/document' )
34
33
self .pip_latest_document_page_url = url_base .format (version = '/en/latest/document.html' )
35
34
36
35
with mock .patch ('readthedocs.projects.models.broadcast' ):
@@ -45,136 +44,40 @@ def test_project_only(self):
45
44
url = core_tags .make_document_url (proj , '' )
46
45
self .assertEqual (url , self .pip_latest_url )
47
46
48
- def test_project_only_htmldir (self ):
49
- proj = Project .objects .get (slug = 'pip' )
50
- proj .documentation_type = 'sphinx_htmldir'
51
- url = core_tags .make_document_url (proj )
52
- self .assertEqual (url , self .pip_latest_url )
53
- url = core_tags .make_document_url (proj , '' )
54
- self .assertEqual (url , self .pip_latest_url )
55
-
56
- def test_project_only_singlehtml (self ):
57
- proj = Project .objects .get (slug = 'pip' )
58
- proj .documentation_type = 'sphinx_singlehtml'
59
- url = core_tags .make_document_url (proj )
60
- self .assertEqual (url , self .pip_latest_url )
61
- url = core_tags .make_document_url (proj , '' )
62
- self .assertEqual (url , self .pip_latest_url )
63
-
64
47
def test_translation_project_only (self ):
65
48
proj = Project .objects .get (slug = 'pip-fr' )
66
49
url = core_tags .make_document_url (proj )
67
50
self .assertEqual (url , self .pip_latest_fr_url )
68
51
url = core_tags .make_document_url (proj , '' )
69
52
self .assertEqual (url , self .pip_latest_fr_url )
70
53
71
- def test_translation_project_only_htmldir (self ):
72
- proj = Project .objects .get (slug = 'pip-fr' )
73
- proj .documentation_type = 'sphinx_htmldir'
74
- url = core_tags .make_document_url (proj )
75
- self .assertEqual (url , self .pip_latest_fr_url )
76
- url = core_tags .make_document_url (proj , '' )
77
- self .assertEqual (url , self .pip_latest_fr_url )
78
-
79
- def test_translation_project_only_singlehtml (self ):
80
- proj = Project .objects .get (slug = 'pip-fr' )
81
- proj .documentation_type = 'sphinx_singlehtml'
82
- url = core_tags .make_document_url (proj )
83
- self .assertEqual (url , self .pip_latest_fr_url )
84
- url = core_tags .make_document_url (proj , '' )
85
- self .assertEqual (url , self .pip_latest_fr_url )
86
-
87
54
def test_project_and_version (self ):
88
55
proj = Project .objects .get (slug = 'pip' )
89
56
url = core_tags .make_document_url (proj , 'abc' )
90
57
self .assertEqual (url , self .pip_abc_url )
91
58
url = core_tags .make_document_url (proj , 'abc' , '' )
92
59
self .assertEqual (url , self .pip_abc_url )
93
60
94
- def test_project_and_version_htmldir (self ):
95
- proj = Project .objects .get (slug = 'pip' )
96
- proj .documentation_type = 'sphinx_htmldir'
97
- url = core_tags .make_document_url (proj , 'abc' )
98
- self .assertEqual (url , self .pip_abc_url )
99
- url = core_tags .make_document_url (proj , 'abc' , '' )
100
- self .assertEqual (url , self .pip_abc_url )
101
-
102
- def test_project_and_version_singlehtml (self ):
103
- proj = Project .objects .get (slug = 'pip' )
104
- proj .documentation_type = 'sphinx_singlehtml'
105
- url = core_tags .make_document_url (proj , 'abc' )
106
- self .assertEqual (url , self .pip_abc_url )
107
- url = core_tags .make_document_url (proj , 'abc' , '' )
108
- self .assertEqual (url , self .pip_abc_url )
109
-
110
61
def test_translation_project_and_version (self ):
111
62
proj = Project .objects .get (slug = 'pip-fr' )
112
63
url = core_tags .make_document_url (proj , 'abc' )
113
64
self .assertEqual (url , self .pip_abc_fr_url )
114
65
url = core_tags .make_document_url (proj , 'abc' , '' )
115
66
self .assertEqual (url , self .pip_abc_fr_url )
116
67
117
- def test_translation_project_and_version_htmldir (self ):
118
- proj = Project .objects .get (slug = 'pip-fr' )
119
- proj .documentation_type = 'sphinx_htmldir'
120
- url = core_tags .make_document_url (proj , 'abc' )
121
- self .assertEqual (url , self .pip_abc_fr_url )
122
- url = core_tags .make_document_url (proj , 'abc' , '' )
123
- self .assertEqual (url , self .pip_abc_fr_url )
124
-
125
- def test_translation_project_and_version_singlehtml (self ):
126
- proj = Project .objects .get (slug = 'pip-fr' )
127
- proj .documentation_type = 'sphinx_singlehtml'
128
- url = core_tags .make_document_url (proj , 'abc' )
129
- self .assertEqual (url , self .pip_abc_fr_url )
130
- url = core_tags .make_document_url (proj , 'abc' , '' )
131
- self .assertEqual (url , self .pip_abc_fr_url )
132
-
133
68
def test_project_and_version_and_page (self ):
134
69
proj = Project .objects .get (slug = 'pip' )
135
70
url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
136
71
self .assertEqual (url , self .pip_abc_xyz_page_url )
137
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
138
- self .assertEqual (url , self .pip_abc_url )
139
-
140
- def test_project_and_version_and_page_htmldir (self ):
141
- proj = Project .objects .get (slug = 'pip' )
142
- proj .documentation_type = 'sphinx_htmldir'
143
- url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
144
- self .assertEqual (url , self .pip_abc_xyz_dir_url )
145
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
146
- self .assertEqual (url , self .pip_abc_url )
147
-
148
- def test_project_and_version_and_page_signlehtml (self ):
149
- proj = Project .objects .get (slug = 'pip' )
150
- proj .documentation_type = 'sphinx_singlehtml'
151
- url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
152
- self .assertEqual (url , self .pip_abc_xyz_document )
153
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
154
- self .assertEqual (url , self .pip_abc_url )
72
+ url = core_tags .make_document_url (proj , 'abc' , 'index.html' )
73
+ self .assertEqual (url , self .pip_abc_url_index )
155
74
156
75
def test_translation_project_and_version_and_page (self ):
157
76
proj = Project .objects .get (slug = 'pip-fr' )
158
77
url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
159
78
self .assertEqual (url , self .pip_abc_xyz_fr_page_url )
160
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
161
- self .assertEqual (url , self .pip_abc_fr_url )
162
-
163
- def test_translation_project_and_version_and_page_htmldir (self ):
164
- proj = Project .objects .get (slug = 'pip-fr' )
165
- proj .documentation_type = 'sphinx_htmldir'
166
- url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
167
- self .assertEqual (url , self .pip_abc_xyz_fr_dir_url )
168
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
169
- self .assertEqual (url , self .pip_abc_fr_url )
170
-
171
- def test_translation_project_and_version_and_page_singlehtml (self ):
172
- proj = Project .objects .get (slug = 'pip-fr' )
173
- proj .documentation_type = 'sphinx_singlehtml'
174
- url = core_tags .make_document_url (proj , 'abc' , 'xyz' )
175
- self .assertEqual (url , self .pip_abc_xyz_fr_document )
176
- url = core_tags .make_document_url (proj , 'abc' , 'index' )
177
- self .assertEqual (url , self .pip_abc_fr_url )
79
+ url = core_tags .make_document_url (proj , 'abc' , 'index.html' )
80
+ self .assertEqual (url , self .pip_abc_fr_url_index )
178
81
179
82
def test_mkdocs (self ):
180
83
proj = Project .objects .get (slug = 'pip' )
@@ -188,17 +91,11 @@ def test_mkdocs_no_directory_urls(self):
188
91
url = core_tags .make_document_url (proj , LATEST , 'document.html' )
189
92
self .assertEqual (url , self .pip_latest_document_page_url )
190
93
191
- def test_mkdocs_index (self ):
192
- proj = Project .objects .get (slug = 'pip' )
193
- proj .documentation_type = 'mkdocs'
194
- url = core_tags .make_document_url (proj , LATEST , 'index' )
195
- self .assertEqual (url , self .pip_latest_url )
196
-
197
94
def test_mkdocs_index_no_directory_urls (self ):
198
95
proj = Project .objects .get (slug = 'pip' )
199
96
proj .documentation_type = 'mkdocs'
200
97
url = core_tags .make_document_url (proj , LATEST , 'index.html' )
201
- self .assertEqual (url , self .pip_latest_url )
98
+ self .assertEqual (url , self .pip_latest_url_index )
202
99
203
100
def test_restructured_text (self ):
204
101
value = '*test*'
0 commit comments