我使用 Django FactoryBoy 进行测试。这是我的代码:
import Factory
class UserFactory(factory.Factory):
FACTORY_FOR = User
username = factory.Sequence(lambda n: 'user' + n)
email = 'test@test.com'
password = 'sha1$$a4483ce7bd7083999bef6a74117a443239e67fac'
这是我的错误:
username = factory.Sequence(lambda n: 'user' + n)
TypeError:无法连接“str”和“int”对象
我该如何解决?