Show More
@@ -59,7 +59,9 class TestLoginController(TestController | |||||
59 | assert 'invalid user name' in response.body, 'No error username message in response' |
|
59 | assert 'invalid user name' in response.body, 'No error username message in response' | |
60 | assert 'invalid password' in response.body, 'No error password message in response' |
|
60 | assert 'invalid password' in response.body, 'No error password message in response' | |
61 |
|
61 | |||
62 |
|
62 | #========================================================================== | ||
|
63 | # REGISTRATIONS | |||
|
64 | #========================================================================== | |||
63 | def test_register(self): |
|
65 | def test_register(self): | |
64 | response = self.app.get(url(controller='login', action='register')) |
|
66 | response = self.app.get(url(controller='login', action='register')) | |
65 | assert 'Sign Up to rhodecode' in response.body, 'wrong page for user registration' |
|
67 | assert 'Sign Up to rhodecode' in response.body, 'wrong page for user registration' | |
@@ -67,7 +69,8 class TestLoginController(TestController | |||||
67 | def test_register_err_same_username(self): |
|
69 | def test_register_err_same_username(self): | |
68 | response = self.app.post(url(controller='login', action='register'), |
|
70 | response = self.app.post(url(controller='login', action='register'), | |
69 | {'username':'test_admin', |
|
71 | {'username':'test_admin', | |
70 | 'password':'test', |
|
72 | 'password':'test12', | |
|
73 | 'password_confirmation':'test12', | |||
71 | 'email':'goodmail@domain.com', |
|
74 | 'email':'goodmail@domain.com', | |
72 | 'name':'test', |
|
75 | 'name':'test', | |
73 | 'lastname':'test'}) |
|
76 | 'lastname':'test'}) | |
@@ -78,7 +81,8 class TestLoginController(TestController | |||||
78 | def test_register_err_wrong_data(self): |
|
81 | def test_register_err_wrong_data(self): | |
79 | response = self.app.post(url(controller='login', action='register'), |
|
82 | response = self.app.post(url(controller='login', action='register'), | |
80 | {'username':'xs', |
|
83 | {'username':'xs', | |
81 | 'password':'', |
|
84 | 'password':'test', | |
|
85 | 'password_confirmation':'test', | |||
82 | 'email':'goodmailm', |
|
86 | 'email':'goodmailm', | |
83 | 'name':'test', |
|
87 | 'name':'test', | |
84 | 'lastname':'test'}) |
|
88 | 'lastname':'test'}) | |
@@ -88,6 +92,30 class TestLoginController(TestController | |||||
88 | assert 'Please enter a value' in response.body |
|
92 | assert 'Please enter a value' in response.body | |
89 |
|
93 | |||
90 |
|
94 | |||
|
95 | def test_register_special_chars(self): | |||
|
96 | response = self.app.post(url(controller='login', action='register'), | |||
|
97 | {'username':'xxxaxn', | |||
|
98 | 'password':'Δ ΔΕΊΕΌΔ ΕΕΕΕ', | |||
|
99 | 'password_confirmation':'Δ ΔΕΊΕΌΔ ΕΕΕΕ', | |||
|
100 | 'email':'goodmailm', | |||
|
101 | 'name':'test', | |||
|
102 | 'lastname':'test@test.plx'}) | |||
|
103 | ||||
|
104 | assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status | |||
|
105 | assert 'Invalid characters in password' in response.body | |||
|
106 | ||||
|
107 | ||||
|
108 | def test_register_password_mismatch(self): | |||
|
109 | response = self.app.post(url(controller='login', action='register'), | |||
|
110 | {'username':'xs', | |||
|
111 | 'password':'123qwe', | |||
|
112 | 'password_confirmation':'qwe123', | |||
|
113 | 'email':'goodmailm', | |||
|
114 | 'name':'test', | |||
|
115 | 'lastname':'test@test.plxa'}) | |||
|
116 | ||||
|
117 | assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status | |||
|
118 | assert 'Password do not match' in response.body | |||
91 |
|
119 | |||
92 | def test_register_ok(self): |
|
120 | def test_register_ok(self): | |
93 | username = 'test_regular4' |
|
121 | username = 'test_regular4' | |
@@ -99,6 +127,7 class TestLoginController(TestController | |||||
99 | response = self.app.post(url(controller='login', action='register'), |
|
127 | response = self.app.post(url(controller='login', action='register'), | |
100 | {'username':username, |
|
128 | {'username':username, | |
101 | 'password':password, |
|
129 | 'password':password, | |
|
130 | 'password_confirmation':password, | |||
102 | 'email':email, |
|
131 | 'email':email, | |
103 | 'name':name, |
|
132 | 'name':name, | |
104 | 'lastname':lastname}) |
|
133 | 'lastname':lastname}) |
General Comments 0
You need to be logged in to leave comments.
Login now