-1
我使用Django FactoryBoy進行測試。這是我的代碼:TypeError:無法連接'str'和'int'對象 - lambda
import Factory
class UserFactory(factory.Factory):
FACTORY_FOR = User
username = factory.Sequence(lambda n: 'user' + n)
email = '[email protected]'
password = 'sha1$$a4483ce7bd7083999bef6a74117a443239e67fac'
,在這裏我的錯誤:
username = factory.Sequence(lambda n: 'user' + n)
TypeError: cannot concatenate 'str' and 'int' objects
我怎樣才能解決這個問題?