コード例 #1
0
ファイル: test_models.py プロジェクト: alvaromartin/baph
 def test_activation_email(self):
     ''':meth:`RegistrationProfile.send_activation_email` sends an email.
     '''
     new_user = User.create_user(**self.user_info)
     profile = RegistrationProfile.create_profile(new_user)
     profile.send_activation_email(Site.get_current())
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, [self.user_info['email']])
コード例 #2
0
ファイル: test_models.py プロジェクト: gabrielx52/baph
 def test_activation_email(self):
     ''':meth:`RegistrationProfile.send_activation_email` sends an email.
     '''
     new_user = User.create_user(**self.user_info)
     profile = RegistrationProfile.create_profile(new_user)
     profile.send_activation_email(Site.get_current())
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, [self.user_info['email']])
コード例 #3
0
ファイル: test_models.py プロジェクト: alvaromartin/baph
    def test_profile_creation(self):
        '''Creating a registration profile for a user populates the
        profile with the correct user and a SHA1 hash to use as
        activation key.
        '''
        new_user = User.create_user(**self.user_info)
        profile = RegistrationProfile.create_profile(new_user)

        ct = self.session.query(RegistrationProfile).count()

        self.assertEqual(ct, 1)
        self.assertEqual(profile.user.id, new_user.id)
        self.assertRegexpMatches(profile.activation_key, '^[a-f0-9]{40}$')
        self.assertEqual(unicode(profile),
                         u'Registration information for alice')
コード例 #4
0
ファイル: test_models.py プロジェクト: gabrielx52/baph
    def test_profile_creation(self):
        '''Creating a registration profile for a user populates the
        profile with the correct user and a SHA1 hash to use as
        activation key.
        '''
        new_user = User.create_user(**self.user_info)
        profile = RegistrationProfile.create_profile(new_user)

        ct = self.session.query(RegistrationProfile).count()

        self.assertEqual(ct, 1)
        self.assertEqual(profile.user.id, new_user.id)
        self.assertRegexpMatches(profile.activation_key, '^[a-f0-9]{40}$')
        self.assertEqual(unicode(profile),
                         u'Registration information for alice')