Fix friend_code max length issues in tests, and fix in_game_name length issues, also update tests to fit more scenarios
This commit is contained in:
parent
0d4655bf80
commit
b9c4d7a61d
10 changed files with 558 additions and 66 deletions
|
|
@ -9,6 +9,7 @@ from accounts.models import CustomUser, FriendCode
|
|||
from cards.models import Card, Deck, DeckNameTranslation, CardNameTranslation
|
||||
from trades.models import TradeOffer, TradeOfferHaveCard, TradeOfferWantCard
|
||||
from cards.templatetags import card_badge, card_multiselect
|
||||
from tests.utils.rarity import RARITY_MAPPING
|
||||
|
||||
class CardsModelsTests(TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -19,15 +20,15 @@ class CardsModelsTests(TestCase):
|
|||
name="Test Card",
|
||||
cardset="A",
|
||||
cardnum=1,
|
||||
style="color: blue;",
|
||||
rarity_icon="★",
|
||||
style="default",
|
||||
rarity_icon=RARITY_MAPPING[1],
|
||||
rarity_level=1
|
||||
)
|
||||
# Establish many-to-many relationship.
|
||||
self.card.decks.add(self.deck)
|
||||
|
||||
def test_card_str(self):
|
||||
expected = f"{self.card.name} {self.card.rarity_icon} {self.card.cardset}"
|
||||
expected = f"{self.card.name} ({self.card.cardset} #{self.card.cardnum})"
|
||||
self.assertEqual(str(self.card), expected)
|
||||
|
||||
def test_deck_str(self):
|
||||
|
|
@ -158,8 +159,8 @@ class CardsViewsTests(TestCase):
|
|||
name="Test Card",
|
||||
cardset="A",
|
||||
cardnum=1,
|
||||
style="background: red;",
|
||||
rarity_icon="★",
|
||||
style="default",
|
||||
rarity_icon=RARITY_MAPPING[1],
|
||||
rarity_level=1
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue