File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 31
31
< body >
32
32
< div class ="container ">
33
33
< h1 > Virtual Competition Code Submission</ h1 >
34
+ {% if 'blueshirt' in request.auth.scopes %}
35
+ < div class ="row ">
36
+ < div class ="col-sm-6 ">
37
+ < a href ="{{ url_for('download_submissions') }} ">
38
+ Download current chosen submissions
39
+ </ a >
40
+ </ div >
41
+ </ div >
42
+ {% endif %}
34
43
< div class ="row ">
35
44
{% if request.user.team %}
36
45
< form
Original file line number Diff line number Diff line change @@ -276,6 +276,23 @@ def test_upload_archive_without_robot_py(self) -> None:
276
276
)
277
277
self .assertEqual ([], choices , "Should not have created a choice" )
278
278
279
+ def test_no_download_link_for_non_blueshirt (self ) -> None :
280
+ download_url = self .url_for ('download_submissions' )
281
+
282
+ response = self .session .get (self .url_for ('homepage' ))
283
+
284
+ html = response .text
285
+ self .assertNotIn (download_url , html )
286
+
287
+ def test_shows_download_link_for_blueshirt (self ) -> None :
288
+ self .session .auth = ('blueshirt' , 'blueshirt' )
289
+
290
+ download_url = self .url_for ('download_submissions' )
291
+
292
+ response = self .session .get (self .url_for ('homepage' ))
293
+ html = response .text
294
+ self .assertIn (download_url , html )
295
+
279
296
def test_download_submissions_requires_blueshirt (self ) -> None :
280
297
response = self .session .get (self .url_for ('download_submissions' ))
281
298
self .assertEqual (403 , response .status_code )
You can’t perform that action at this time.
0 commit comments