1
1
import io
2
+ import json
2
3
import asyncio
3
4
import zipfile
4
5
import datetime
@@ -28,6 +29,11 @@ def setUpModule() -> None:
28
29
environ ['TESTING' ] = 'True'
29
30
environ ['DATABASE_URL' ] = url
30
31
32
+ environ ['AUTH_BACKEND' ] = json .dumps ({
33
+ 'backend' : 'code_submitter.auth.DummyBackend' ,
34
+ 'kwargs' : {'team' : 'SRZ2' },
35
+ })
36
+
31
37
create_engine (url )
32
38
33
39
alembic .command .upgrade (Config ('alembic.ini' ), 'head' )
@@ -81,7 +87,7 @@ def test_shows_own_and_own_team_uploads(self) -> None:
81
87
id = 2222222222 ,
82
88
content = b'' ,
83
89
username = 'a_colleague' ,
84
- team = 'SRZ ' ,
90
+ team = 'SRZ2 ' ,
85
91
created = datetime .datetime (2020 , 2 , 2 , 12 , 0 ),
86
92
),
87
93
))
@@ -90,7 +96,7 @@ def test_shows_own_and_own_team_uploads(self) -> None:
90
96
id = 1111111111 ,
91
97
content = b'' ,
92
98
username = 'test_user' ,
93
- team = 'SRZ ' ,
99
+ team = 'SRZ2 ' ,
94
100
created = datetime .datetime (2020 , 1 , 1 , 12 , 0 ),
95
101
),
96
102
))
@@ -127,7 +133,7 @@ def test_shows_chosen_archive(self) -> None:
127
133
id = 2222222222 ,
128
134
content = b'' ,
129
135
username = 'a_colleague' ,
130
- team = 'SRZ ' ,
136
+ team = 'SRZ2 ' ,
131
137
created = datetime .datetime (2020 , 2 , 2 , 12 , 0 ),
132
138
),
133
139
))
@@ -136,7 +142,7 @@ def test_shows_chosen_archive(self) -> None:
136
142
id = 1111111111 ,
137
143
content = b'' ,
138
144
username = 'test_user' ,
139
- team = 'SRZ ' ,
145
+ team = 'SRZ2 ' ,
140
146
created = datetime .datetime (2020 , 1 , 1 , 12 , 0 ),
141
147
),
142
148
))
@@ -209,7 +215,7 @@ def test_upload_file(self) -> None:
209
215
)
210
216
211
217
self .assertEqual (
212
- ['SRZ ' ],
218
+ ['SRZ2 ' ],
213
219
[x ['team' ] for x in archives ],
214
220
"Wrong team stored in the database" ,
215
221
)
0 commit comments