admin_actions.py 文件源码

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

项目:gougo 作者: amaozhao 项目源码 文件源码
def test_resend_activation_email(self):
        """
        Test the admin custom command 'resend activation email'
        """
        new_user = UserModel().objects.create_user(**self.user_info)
        profile = RegistrationProfile.objects.create_profile(new_user)

        registrationprofile_list = urlresolvers.reverse('admin:registration_registrationprofile_changelist')
        post_data = {
            'action': 'resend_activation_email',
            helpers.ACTION_CHECKBOX_NAME: [profile.pk],
        }
        self.client.post(registrationprofile_list, post_data, follow=True)

        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].to, [self.user_info['email']])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号