Exemple #1
0
    def testInviteCreatesUser(self):
        """We should get a new user when inviting something"""
        me = User()
        me.username = u'me'
        me.email = u'me.com'
        me.invite_ct = 2
        you = me.invite(u'you.com')

        self.assertEqual(
            'you.com',
            you.username,
            'The email should be the username')
        self.assertEqual(
            'you.com',
            you.email,
            'The email should be the email')
        self.assertTrue(
            len(you.api_key),
            'The api key should be generated for the user')
        self.assertFalse(
            you.activated,
            'The new user should not be activated')
        self.assertEqual(
            1,
            me.invite_ct,
            'My invite count should be deprecated')
Exemple #2
0
 def testHasNoInvites(self):
     """Verify that if the user has no invites, they can't invite"""
     u = User()
     u.invite_ct = 0
     self.assertFalse(u.has_invites(), 'User should have no invites')
     self.assertFalse(
         u.invite('*****@*****.**'), 'Should not be able to invite a user')
Exemple #3
0
 def testHasNoInvites(self):
     """Verify that if the user has no invites, they can't invite"""
     u = User()
     u.invite_ct = 0
     self.assertFalse(u.has_invites(), 'User should have no invites')
     self.assertFalse(u.invite('*****@*****.**'),
                      'Should not be able to invite a user')
Exemple #4
0
    def testInviteCreatesUser(self):
        """We should get a new user when inviting something"""
        me = User()
        me.username = '******'
        me.email = 'me.com'
        me.invite_ct = 2
        you = me.invite('you.com')

        eq_('you.com', you.username, 'The email should be the username')
        eq_('you.com', you.email, 'The email should be the email')
        ok_(len(you.api_key), 'The api key should be generated for the user')
        ok_(not you.activated, 'The new user should not be activated')
        eq_(1, me.invite_ct, 'My invite count should be deprecated')