@pytest.mark.django_db
def test_create_project_good(english):
 proj = Project(code='hello', fullname='world', source_language=english)
 proj.save()
 proj.delete()
 code_with_padding = '  hello  '
 fullname_with_padding = '  world  '
 proj = Project(code=code_with_padding, fullname='world', source_language=english)
 proj.save()
 assert (proj.code == code_with_padding.strip())
 proj.delete()
 proj = Project(code='hello', fullname=fullname_with_padding, source_language=english)
 proj.save()
 assert (proj.fullname == fullname_with_padding.strip())
 proj.delete()
 proj = Project(code=code_with_padding, fullname=fullname_with_padding, source_language=english)
 proj.save()
 assert (proj.code == code_with_padding.strip())
 assert (proj.fullname == fullname_with_padding.strip())
 proj.delete()

@ pytest . mark . django_db def test_create_project_good ( english ) : proj = Project ( code = 'hello' , fullname = 'world' , source_language = english ) proj . save ( ) proj . delete ( ) code_with_padding = '  hello  ' fullname_with_padding = '  world  ' proj = Project ( code = code_with_padding , fullname = 'world' , source_language = english ) proj . save ( ) assert ( proj . code == code_with_padding . strip ( ) ) proj . delete ( ) proj = Project ( code = 'hello' , fullname = fullname_with_padding , source_language = english ) proj . save ( ) assert ( proj . fullname == fullname_with_padding . strip ( ) ) proj . delete ( ) proj = Project ( code = code_with_padding , fullname = fullname_with_padding , source_language = english ) proj . save ( ) assert ( proj . code == code_with_padding . strip ( ) ) assert ( proj . fullname == fullname_with_padding . strip ( ) ) proj . delete ( )
tests projects are created with valid arguments only .