@@ -75,8 +75,12 @@ def test_private_repo(self):
75
75
self .client .login (username = 'eric' , password = 'test' )
76
76
r = self .client .get ('/projects/django-kong/' )
77
77
self .assertEqual (r .status_code , 200 )
78
+ # Build button should appear here
79
+ self .assertContains (r , 'Build a version' )
78
80
r = self .client .get ('/projects/django-kong/builds/' )
79
81
self .assertEqual (r .status_code , 200 )
82
+ # Build button should appear here
83
+ self .assertContains (r , 'Build Version:' )
80
84
r = self .client .get ('/projects/django-kong/downloads/' )
81
85
self .assertEqual (r .status_code , 200 )
82
86
@@ -100,16 +104,24 @@ def test_public_repo(self):
100
104
self .client .login (username = 'eric' , password = 'test' )
101
105
r = self .client .get ('/projects/django-kong/' )
102
106
self .assertEqual (r .status_code , 200 )
107
+ # Build button should appear here
108
+ self .assertContains (r , 'Build a version' )
103
109
r = self .client .get ('/projects/django-kong/builds/' )
104
110
self .assertEqual (r .status_code , 200 )
111
+ # Build button should appear here
112
+ self .assertContains (r , 'Build Version:' )
105
113
r = self .client .get ('/projects/django-kong/downloads/' )
106
114
self .assertEqual (r .status_code , 200 )
107
115
108
116
self .client .login (username = 'tester' , password = 'test' )
109
117
r = self .client .get ('/projects/django-kong/' )
110
118
self .assertEqual (r .status_code , 200 )
119
+ # Build button shouldn't appear here
120
+ self .assertNotContains (r , 'Build a version' )
111
121
r = self .client .get ('/projects/django-kong/builds/' )
112
122
self .assertEqual (r .status_code , 200 )
123
+ # Build button shouldn't appear here
124
+ self .assertNotContains (r , 'Build Version:' )
113
125
r = self .client .get ('/projects/django-kong/downloads/' )
114
126
self .assertEqual (r .status_code , 200 )
115
127
@@ -138,13 +150,14 @@ def test_public_branch(self):
138
150
139
151
self .client .login (username = 'eric' , password = 'test' )
140
152
Version .objects .create (project = kong , identifier = 'test id' ,
141
- verbose_name = 'test verbose' , slug = 'test-slug' , active = True )
153
+ verbose_name = 'test verbose' , slug = 'test-slug' ,
154
+ active = True , built = True )
142
155
self .assertEqual (Version .objects .count (), 2 )
143
156
self .assertEqual (Version .objects .all ()[0 ].privacy_level , 'public' )
144
157
r = self .client .get ('/projects/django-kong/' )
145
158
self .assertContains (r , 'test-slug' )
146
159
147
- # Make sure it doesn't show up as tester
160
+ # Make sure it does show up as tester
148
161
self .client .login (username = 'tester' , password = 'test' )
149
162
r = self .client .get ('/projects/django-kong/' )
150
163
self .assertContains (r , 'test-slug' )
0 commit comments