@pytest.mark.django_db
def test_directory_create_name_with_slashes_or_backslashes(root):
 with pytest.raises(ValidationError):
  Directory.objects.create(name='slashed/name', parent=root)
 with pytest.raises(ValidationError):
  Directory.objects.create(name='backslashed\\name', parent=root)

@ pytest . mark . django_db def test_directory_create_name_with_slashes_or_backslashes ( root ) : with pytest . raises ( ValidationError ) : Directory . objects . create ( name = 'slashed/name' , parent = root ) with pytest . raises ( ValidationError ) : Directory . objects . create ( name = 'backslashed\\name' , parent = root )
test directories are not created with slashes on their name .