def to_python(self, value): cs = get_champions().keys() champ = canonical_champ(cs, value) if champ is None: raise ValidationError() return champ
def to_python(self, value): cs = get_champions().keys() champ = canonical_champ(cs, value) if champ is None: raise ValidationError() return champ
def test_nickname_overlapping(self): i = "cassie" o = "Cassiopeia" self.assertEqual(canonical_champ(self.cs, i), o)
def test_nickname(self): i = "pig" o = "Sejuani" self.assertEqual(canonical_champ(self.cs, i), o)
def test_short_lowercase(self): i = "kat" o = "Katarina" self.assertEqual(canonical_champ(self.cs, i), o)
def test_short_overlapping(self): i = "Mal" o = None self.assertEqual(canonical_champ(self.cs, i), o)
def test_exact(self): i = "Katarina" o = "Katarina" self.assertEqual(canonical_champ(self.cs, i), o)