Exemple #1
0
 def test_fail_register(self):
     r = YayClient.register(self.opts, '    ', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'my\'name', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a  b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a_b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a-b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
 def test_fail_register(self):
     r = YayClient.register(self.opts, '    ', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'my\'name', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a  b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a_b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a-b', '*****@*****.**', 'a', 'a')
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
Exemple #3
0
    def test_yay_register(self):

        # register existing yay username
        r = YayClient.register(self.opts, 'dh', '*****@*****.**', 'a', 'a')
        j = simplejson.loads(r.content)
        self.assertEqual(j['method'], 'yaypm')
        self.assertEqual(r.status_code, 201)
        self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))

        # attempt to login, should fail because not activated
        failed_login = YayClient.login(self.opts, 'dh', 'a')
        self.assertEqual(failed_login.status_code, 401)
        self.assertFalse(YayClient.is_logged_in(self.opts, failed_login.cookies))

        # perform activation
        activate_url = OldYayClient.read_last_pm_link('yayname', 'yaypass')
        activate = requests.get(activate_url)
        self.assertEqual(activate.status_code, 200)

        # Yay, should now be able to login
        login = YayClient.login(self.opts, 'dh', 'a')
        self.assertEqual(login.status_code, 200)
        self.assertTrue(YayClient.is_logged_in(self.opts, login.cookies))
Exemple #4
0
 def test_failed_login(self):
     r = YayClient.login(self.opts, 'madeupname', 'madeuppass')
     self.assertEqual(r.status_code, 401)
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
Exemple #5
0
 def test_new_register(self):
     r = YayClient.register(self.opts, 'neudjcshfo', '*****@*****.**', 'a', 'a')
     j = simplejson.loads(r.content)
     self.assertEqual(j['method'], 'plain')
     self.assertEqual(r.status_code, 201)
     self.assertTrue(YayClient.is_logged_in(self.opts, r.cookies))
Exemple #6
0
 def test_new_register(self):
     r = YayClient.register(self.opts, 'neudjcshfo', '*****@*****.**', 'a', 'a')
     self.assertTrue(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a b', '*****@*****.**', 'a', 'a')
     self.assertTrue(YayClient.is_logged_in(self.opts, r.cookies))
 def test_failed_login(self):
     r = YayClient.login(self.opts, 'madeupname', 'madeuppass')
     self.assertEqual(r.status_code, 401)
     self.assertFalse(YayClient.is_logged_in(self.opts, r.cookies))
 def test_new_register(self):
     r = YayClient.register(self.opts, 'neudjcshfo', '*****@*****.**', 'a', 'a')
     self.assertTrue(YayClient.is_logged_in(self.opts, r.cookies))
     r = YayClient.register(self.opts, 'a b', '*****@*****.**', 'a', 'a')
     self.assertTrue(YayClient.is_logged_in(self.opts, r.cookies))