我在我的测试.py在
class TestAdding(TestCase):
def setUp(self):
username = 'testuser'
password = 'testpass'
user = User.objects.create_user(username, password=password)
self.client = Client()
logged_in = self.client.login(username=username, password=password)
self.assertTrue(logged_in)
我得到以下错误
^{pr2}$我检查了用户是否被创建了,它确实创建了。在
唯一的问题是登录。在
编辑:我的设置文件的这些部分可能是相关的。在
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
'guardian.backends.ObjectPermissionBackend',
)
ACCOUNT_AUTHENTICATION_METHOD = 'username'
目前没有回答
相关问题 更多 >
编程相关推荐