File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
readthedocs/proxito/tests Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,34 @@ def test_external_version_serving(self):
170
170
resp ['x-accel-redirect' ], '/proxito/media/external/html/project/10/awesome.html' ,
171
171
)
172
172
173
- # Invalid tests
173
+ @override_settings (
174
+ RTD_EXTERNAL_VERSION_DOMAIN = 'dev.readthedocs.build' ,
175
+ )
176
+ def test_external_version_serving_old_slugs (self ):
177
+ """
178
+ Test external version serving with projects with `--` in their slug.
179
+
180
+ Some old projects may have been created with a slug containg `--`,
181
+ our current code doesn't allow these type of slugs.
182
+ """
183
+ fixture .get (
184
+ Version ,
185
+ verbose_name = '10' ,
186
+ slug = '10' ,
187
+ type = EXTERNAL ,
188
+ active = True ,
189
+ project = self .project ,
190
+ )
191
+ self .project .slug = 'test--project'
192
+ self .project .save ()
193
+
194
+ host = 'test--project--10.dev.readthedocs.build'
195
+ resp = self .client .get ('/awesome.html' , HTTP_HOST = host )
196
+ self .assertEqual (
197
+ resp ['x-accel-redirect' ], '/proxito/media/external/html/test--project/10/awesome.html' ,
198
+ )
199
+
200
+ # Invalid tests
174
201
175
202
@override_settings (
176
203
RTD_EXTERNAL_VERSION_DOMAIN = 'dev.readthedocs.build' ,
You can’t perform that action at this time.
0 commit comments