def game_page(context): battle = Battle1x1Prototype.get_by_account_id(context.account.id) if battle and battle.state.is_PROCESSING: return dext_views.Redirect(url('game:pvp:')) clan = None if context.account.clan_id is not None: clan = ClanPrototype.get_by_id(context.account.clan_id) cards = sorted(list(EFFECTS.values()), key=lambda x: (x.TYPE.rarity.value, x.TYPE.text)) return dext_views.Page('game/game_page.html', content={ 'map_settings': map_settings, 'game_settings': game_settings, 'EQUIPMENT_SLOT': EQUIPMENT_SLOT, 'current_map_version': map_info_storage.version, 'clan': clan, 'CARDS': cards, 'resource': context.resource, 'hero': context.account_hero, 'ABILITY_TYPE': ABILITY_TYPE })
def test_availability_filter(self): for availability in relations.AVAILABILITY.records: texts = [ card.TYPE.text for card in list(EFFECTS.values()) if card.TYPE.availability == availability ] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
def test_rarity_filter(self): for rarity in relations.RARITY.records: texts = [ card.TYPE.text for card in list(EFFECTS.values()) if card.TYPE.rarity == rarity ] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
def game_page(context): battle = Battle1x1Prototype.get_by_account_id(context.account.id) if battle and battle.state.is_PROCESSING: return dext_views.Redirect(url('game:pvp:')) clan = None if context.account.clan_id is not None: clan = ClanPrototype.get_by_id(context.account.clan_id) cards = sorted(EFFECTS.values(), key=lambda x: (x.TYPE.rarity.value, x.TYPE.text)) return dext_views.Page('game/game_page.html', content={'map_settings': map_settings, 'game_settings': game_settings, 'EQUIPMENT_SLOT': EQUIPMENT_SLOT, 'current_map_version': map_info_storage.version, 'clan': clan, 'CARDS': cards, 'resource': context.resource, 'hero': context.account_hero} )
def test_simple(self): texts = [card.TYPE.text for card in list(EFFECTS.values())] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
def test_availability_filter(self): for availability in relations.AVAILABILITY.records: texts = [card.TYPE.text for card in EFFECTS.values() if card.TYPE.availability == availability] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
def test_rarity_filter(self): for rarity in relations.RARITY.records: texts = [card.TYPE.text for card in EFFECTS.values() if card.TYPE.rarity == rarity] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)
def test_simple(self): texts = [card.TYPE.text for card in EFFECTS.values()] self.check_html_ok(self.request_html(url('guide:cards:')), texts=texts)