Skip to content

Commit d6b9b68

Browse files
committed
Validate specifying the dummy team
1 parent ff0155d commit d6b9b68

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/tests_app.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import io
2+
import json
23
import asyncio
34
import zipfile
45
import datetime
@@ -28,6 +29,11 @@ def setUpModule() -> None:
2829
environ['TESTING'] = 'True'
2930
environ['DATABASE_URL'] = url
3031

32+
environ['AUTH_BACKEND'] = json.dumps({
33+
'backend': 'code_submitter.auth.DummyBackend',
34+
'kwargs': {'team': 'SRZ2'},
35+
})
36+
3137
create_engine(url)
3238

3339
alembic.command.upgrade(Config('alembic.ini'), 'head')
@@ -81,7 +87,7 @@ def test_shows_own_and_own_team_uploads(self) -> None:
8187
id=2222222222,
8288
content=b'',
8389
username='a_colleague',
84-
team='SRZ',
90+
team='SRZ2',
8591
created=datetime.datetime(2020, 2, 2, 12, 0),
8692
),
8793
))
@@ -90,7 +96,7 @@ def test_shows_own_and_own_team_uploads(self) -> None:
9096
id=1111111111,
9197
content=b'',
9298
username='test_user',
93-
team='SRZ',
99+
team='SRZ2',
94100
created=datetime.datetime(2020, 1, 1, 12, 0),
95101
),
96102
))
@@ -127,7 +133,7 @@ def test_shows_chosen_archive(self) -> None:
127133
id=2222222222,
128134
content=b'',
129135
username='a_colleague',
130-
team='SRZ',
136+
team='SRZ2',
131137
created=datetime.datetime(2020, 2, 2, 12, 0),
132138
),
133139
))
@@ -136,7 +142,7 @@ def test_shows_chosen_archive(self) -> None:
136142
id=1111111111,
137143
content=b'',
138144
username='test_user',
139-
team='SRZ',
145+
team='SRZ2',
140146
created=datetime.datetime(2020, 1, 1, 12, 0),
141147
),
142148
))
@@ -209,7 +215,7 @@ def test_upload_file(self) -> None:
209215
)
210216

211217
self.assertEqual(
212-
['SRZ'],
218+
['SRZ2'],
213219
[x['team'] for x in archives],
214220
"Wrong team stored in the database",
215221
)

0 commit comments

Comments
 (0)