您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

test_models.py 282B

12345678910
  1. import pytest
  2. from django.core import exceptions
  3. from oscar.apps.customer import models
  4. def test_communication_event_type_code_forbids_hyphens():
  5. ctype = models.CommunicationEventType(code="A-B")
  6. with pytest.raises(exceptions.ValidationError):
  7. ctype.full_clean()