File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77from ..battles import Battle
88from ..text_unit import TextUnit
9- from .factories import WarriorArenaFactory , batch_create_battles
9+ from .factories import (
10+ GameScoreFactory , WarriorArenaFactory , batch_create_battles ,
11+ )
1012
1113
1214@pytest .mark .django_db
@@ -163,6 +165,22 @@ def test_battle_details(client, battle):
163165 assert response .status_code == 200
164166
165167
168+ @pytest .mark .django_db
169+ def test_battle_details_with_score (client , battle ):
170+ GameScoreFactory (
171+ battle = battle ,
172+ direction = '1_2' ,
173+ algorithm = 'lcs' ,
174+ warrior_1_similarity = 0.5 ,
175+ warrior_2_similarity = 0.5 ,
176+ warriors_similarity = 0.5 ,
177+ )
178+ response = client .get (
179+ reverse ('battle_detail' , args = (battle .id ,))
180+ )
181+ assert response .status_code == 200
182+
183+
166184@pytest .mark .django_db
167185@pytest .mark .parametrize ('warrior' , [
168186 {'public_battle_results' : False },
You can’t perform that action at this time.
0 commit comments