File tree 2 files changed +8
-18
lines changed
readthedocs/rtd_tests/tests
2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change 8
8
from django_dynamic_fixture import get
9
9
from taggit .models import Tag
10
10
11
- from readthedocs .builds .models import Build , BuildCommandResult
11
+ from readthedocs .builds .constants import EXTERNAL
12
+ from readthedocs .builds .models import Build , BuildCommandResult , Version
12
13
from readthedocs .core .utils .tasks import TaskNoPermission
13
14
from readthedocs .integrations .models import HttpExchange , Integration
14
15
from readthedocs .oauth .models import RemoteOrganization , RemoteRepository
@@ -139,7 +140,11 @@ class ProjectMixin(URLAccessMixin):
139
140
140
141
def setUp (self ):
141
142
super ().setUp ()
143
+ self .external_version = get (Version , project = self .pip , type = EXTERNAL )
142
144
self .build = get (Build , project = self .pip )
145
+ self .external_build = get (
146
+ Build , project = self .pip , version = self .external_version
147
+ )
143
148
self .tag = get (Tag , slug = 'coolness' )
144
149
self .subproject = get (
145
150
Project , slug = 'sub' , language = 'ja' ,
Original file line number Diff line number Diff line change @@ -316,24 +316,9 @@ def test_external_build_list_includes_external_version_builds(self):
316
316
self .assertEqual (response .status_code , 200 )
317
317
self .assertIn (external_version_build , response .context ['build_qs' ])
318
318
319
- def test_external_build_list_does_not_include_internal_version_builds (self ):
320
- internal_version = get (
321
- Version ,
322
- project = self .pip ,
323
- active = True ,
324
- type = BRANCH ,
325
- )
326
- internal_version_build = get (
327
- Build ,
328
- project = self .pip ,
329
- version = internal_version
330
- )
319
+ def test_external_build_list_returns_404_if_no_external_build_available (self ):
331
320
response = self .client .get (
332
321
reverse ('external_builds_project_list' , args = [self .pip .slug ]),
333
322
)
334
323
335
- self .assertEqual (response .status_code , 200 )
336
- self .assertNotIn (
337
- internal_version_build ,
338
- response .context ['build_qs' ]
339
- )
324
+ self .assertEqual (response .status_code , 404 )
You can’t perform that action at this time.
0 commit comments