tests.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:drf-simple-auth 作者: nickromano 项目源码 文件源码
def test_username_email_address_validation(self):
        with self.settings(CHECK_USERNAME_IS_EMAIL=True):
            client = APIClient()

            response = client.post(reverse('auth-signup'), {'username': 'test', 'password': 'test'})
            self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

            data = json.loads(response.content.decode('utf-8'))
            self.assertEqual(data, {u'detail': u'Please provide a valid email address.'})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号