Show More
@@ -59,7 +59,9 class TestLoginController(TestController | |||
|
59 | 59 | assert 'invalid user name' in response.body, 'No error username message in response' |
|
60 | 60 | assert 'invalid password' in response.body, 'No error password message in response' |
|
61 | 61 | |
|
62 | ||
|
62 | #========================================================================== | |
|
63 | # REGISTRATIONS | |
|
64 | #========================================================================== | |
|
63 | 65 | def test_register(self): |
|
64 | 66 | response = self.app.get(url(controller='login', action='register')) |
|
65 | 67 | assert 'Sign Up to rhodecode' in response.body, 'wrong page for user registration' |
@@ -67,7 +69,8 class TestLoginController(TestController | |||
|
67 | 69 | def test_register_err_same_username(self): |
|
68 | 70 | response = self.app.post(url(controller='login', action='register'), |
|
69 | 71 | {'username':'test_admin', |
|
70 | 'password':'test', | |
|
72 | 'password':'test12', | |
|
73 | 'password_confirmation':'test12', | |
|
71 | 74 | 'email':'goodmail@domain.com', |
|
72 | 75 | 'name':'test', |
|
73 | 76 | 'lastname':'test'}) |
@@ -78,7 +81,8 class TestLoginController(TestController | |||
|
78 | 81 | def test_register_err_wrong_data(self): |
|
79 | 82 | response = self.app.post(url(controller='login', action='register'), |
|
80 | 83 | {'username':'xs', |
|
81 | 'password':'', | |
|
84 | 'password':'test', | |
|
85 | 'password_confirmation':'test', | |
|
82 | 86 | 'email':'goodmailm', |
|
83 | 87 | 'name':'test', |
|
84 | 88 | 'lastname':'test'}) |
@@ -88,6 +92,30 class TestLoginController(TestController | |||
|
88 | 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 | 120 | def test_register_ok(self): |
|
93 | 121 | username = 'test_regular4' |
@@ -99,6 +127,7 class TestLoginController(TestController | |||
|
99 | 127 | response = self.app.post(url(controller='login', action='register'), |
|
100 | 128 | {'username':username, |
|
101 | 129 | 'password':password, |
|
130 | 'password_confirmation':password, | |
|
102 | 131 | 'email':email, |
|
103 | 132 | 'name':name, |
|
104 | 133 | 'lastname':lastname}) |
General Comments 0
You need to be logged in to leave comments.
Login now