Show More
@@ -99,7 +99,7 b' class BaseTestApi(object):' | |||||
99 | cls.test_user = UserModel().create_or_update( |
|
99 | cls.test_user = UserModel().create_or_update( | |
100 | username='test-api', |
|
100 | username='test-api', | |
101 | password='test', |
|
101 | password='test', | |
102 |
email='test@ |
|
102 | email='test@example.com', | |
103 | firstname='first', |
|
103 | firstname='first', | |
104 | lastname='last' |
|
104 | lastname='last' | |
105 | ) |
|
105 | ) | |
@@ -649,7 +649,7 b' class BaseTestApi(object):' | |||||
649 | def test_api_delete_user(self): |
|
649 | def test_api_delete_user(self): | |
650 | usr = UserModel().create_or_update(username=u'test_user', |
|
650 | usr = UserModel().create_or_update(username=u'test_user', | |
651 | password=u'qweqwe', |
|
651 | password=u'qweqwe', | |
652 |
email=u'u232@ |
|
652 | email=u'u232@example.com', | |
653 | firstname=u'u1', lastname=u'u1') |
|
653 | firstname=u'u1', lastname=u'u1') | |
654 | Session().commit() |
|
654 | Session().commit() | |
655 | username = usr.username |
|
655 | username = usr.username | |
@@ -670,7 +670,7 b' class BaseTestApi(object):' | |||||
670 | def test_api_delete_user_when_exception_happened(self): |
|
670 | def test_api_delete_user_when_exception_happened(self): | |
671 | usr = UserModel().create_or_update(username=u'test_user', |
|
671 | usr = UserModel().create_or_update(username=u'test_user', | |
672 | password=u'qweqwe', |
|
672 | password=u'qweqwe', | |
673 |
email=u'u232@ |
|
673 | email=u'u232@example.com', | |
674 | firstname=u'u1', lastname=u'u1') |
|
674 | firstname=u'u1', lastname=u'u1') | |
675 | Session().commit() |
|
675 | Session().commit() | |
676 | username = usr.username |
|
676 | username = usr.username |
@@ -105,7 +105,7 b' class Fixture(object):' | |||||
105 | defs = dict( |
|
105 | defs = dict( | |
106 | username=name, |
|
106 | username=name, | |
107 | password='qweqwe', |
|
107 | password='qweqwe', | |
108 |
email='%s+test@ |
|
108 | email='%s+test@example.com' % name, | |
109 | firstname='TestUser', |
|
109 | firstname='TestUser', | |
110 | lastname='Test', |
|
110 | lastname='Test', | |
111 | active=True, |
|
111 | active=True, |
@@ -18,7 +18,7 b' class TestNotificationsController(TestCo' | |||||
18 | self.log_user() |
|
18 | self.log_user() | |
19 |
|
19 | |||
20 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', |
|
20 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', | |
21 |
email='u1@ |
|
21 | email='u1@example.com', | |
22 | firstname='u1', lastname='u1') |
|
22 | firstname='u1', lastname='u1') | |
23 | u1 = u1.user_id |
|
23 | u1 = u1.user_id | |
24 |
|
24 | |||
@@ -37,10 +37,10 b' class TestNotificationsController(TestCo' | |||||
37 | cur_user = self._get_logged_user() |
|
37 | cur_user = self._get_logged_user() | |
38 |
|
38 | |||
39 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', |
|
39 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', | |
40 |
email='u1@ |
|
40 | email='u1@example.com', | |
41 | firstname='u1', lastname='u1') |
|
41 | firstname='u1', lastname='u1') | |
42 | u2 = UserModel().create_or_update(username='u2', password='qweqwe', |
|
42 | u2 = UserModel().create_or_update(username='u2', password='qweqwe', | |
43 |
email='u2@ |
|
43 | email='u2@example.com', | |
44 | firstname='u2', lastname='u2') |
|
44 | firstname='u2', lastname='u2') | |
45 |
|
45 | |||
46 | # make notifications |
|
46 | # make notifications | |
@@ -71,10 +71,10 b' class TestNotificationsController(TestCo' | |||||
71 | self.log_user() |
|
71 | self.log_user() | |
72 | cur_user = self._get_logged_user() |
|
72 | cur_user = self._get_logged_user() | |
73 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', |
|
73 | u1 = UserModel().create_or_update(username='u1', password='qweqwe', | |
74 |
email='u1@ |
|
74 | email='u1@example.com', | |
75 | firstname='u1', lastname='u1') |
|
75 | firstname='u1', lastname='u1') | |
76 | u2 = UserModel().create_or_update(username='u2', password='qweqwe', |
|
76 | u2 = UserModel().create_or_update(username='u2', password='qweqwe', | |
77 |
email='u2@ |
|
77 | email='u2@example.com', | |
78 | firstname='u2', lastname='u2') |
|
78 | firstname='u2', lastname='u2') | |
79 |
|
79 | |||
80 | subject = u'test' |
|
80 | subject = u'test' |
@@ -123,7 +123,7 b' class TestAdminUsersController(TestContr' | |||||
123 | def test_update(self, name, attrs): |
|
123 | def test_update(self, name, attrs): | |
124 | self.log_user() |
|
124 | self.log_user() | |
125 | usr = fixture.create_user(self.test_user_1, password='qweqwe', |
|
125 | usr = fixture.create_user(self.test_user_1, password='qweqwe', | |
126 |
email='testme@ |
|
126 | email='testme@example.com', | |
127 | extern_type='rhodecode', |
|
127 | extern_type='rhodecode', | |
128 | extern_name=self.test_user_1, |
|
128 | extern_name=self.test_user_1, | |
129 | skip_if_exists=True) |
|
129 | skip_if_exists=True) |
@@ -33,7 +33,7 b' class _BaseTest(TestController):' | |||||
33 | self.username = u'forkuser' |
|
33 | self.username = u'forkuser' | |
34 | self.password = u'qweqwe' |
|
34 | self.password = u'qweqwe' | |
35 | self.u1 = fixture.create_user(self.username, password=self.password, |
|
35 | self.u1 = fixture.create_user(self.username, password=self.password, | |
36 |
email=u'fork_king@ |
|
36 | email=u'fork_king@example.com') | |
37 | Session().commit() |
|
37 | Session().commit() | |
38 |
|
38 | |||
39 | def tearDown(self): |
|
39 | def tearDown(self): |
@@ -63,7 +63,7 b' class TestLoginController(TestController' | |||||
63 |
|
63 | |||
64 | @parameterized.expand([ |
|
64 | @parameterized.expand([ | |
65 | ('data:text/html,<script>window.alert("xss")</script>',), |
|
65 | ('data:text/html,<script>window.alert("xss")</script>',), | |
66 |
('mailto:test@ |
|
66 | ('mailto:test@example.com',), | |
67 | ('file:///etc/passwd',), |
|
67 | ('file:///etc/passwd',), | |
68 | ('ftp://some.ftp.server',), |
|
68 | ('ftp://some.ftp.server',), | |
69 | ('http://other.domain',), |
|
69 | ('http://other.domain',), |
@@ -108,7 +108,7 b' class TestMyAccountController(TestContro' | |||||
108 | ]) |
|
108 | ]) | |
109 | def test_my_account_update(self, name, attrs): |
|
109 | def test_my_account_update(self, name, attrs): | |
110 | usr = fixture.create_user(self.test_user_1, password='qweqwe', |
|
110 | usr = fixture.create_user(self.test_user_1, password='qweqwe', | |
111 |
email='testme@ |
|
111 | email='testme@example.com', | |
112 | extern_type='rhodecode', |
|
112 | extern_type='rhodecode', | |
113 | extern_name=self.test_user_1, |
|
113 | extern_name=self.test_user_1, | |
114 | skip_if_exists=True) |
|
114 | skip_if_exists=True) |
@@ -54,7 +54,7 b' def _create_project_tree():' | |||||
54 | """ |
|
54 | """ | |
55 | test_u1 = UserModel().create_or_update( |
|
55 | test_u1 = UserModel().create_or_update( | |
56 | username=u'test_u1', password=u'qweqwe', |
|
56 | username=u'test_u1', password=u'qweqwe', | |
57 |
email=u'test_u1@ |
|
57 | email=u'test_u1@example.com', firstname=u'test_u1', lastname=u'test_u1' | |
58 | ) |
|
58 | ) | |
59 | g0 = fixture.create_repo_group('g0') |
|
59 | g0 = fixture.create_repo_group('g0') | |
60 | g0_1 = fixture.create_repo_group('g0_1', group_parent_id=g0) |
|
60 | g0_1 = fixture.create_repo_group('g0_1', group_parent_id=g0) |
@@ -13,21 +13,21 b' class TestNotifications(BaseTestCase):' | |||||
13 | Session.remove() |
|
13 | Session.remove() | |
14 | self.u1 = UserModel().create_or_update(username=u'u1', |
|
14 | self.u1 = UserModel().create_or_update(username=u'u1', | |
15 | password=u'qweqwe', |
|
15 | password=u'qweqwe', | |
16 |
email=u'u1@ |
|
16 | email=u'u1@example.com', | |
17 | firstname=u'u1', lastname=u'u1') |
|
17 | firstname=u'u1', lastname=u'u1') | |
18 | Session().commit() |
|
18 | Session().commit() | |
19 | self.u1 = self.u1.user_id |
|
19 | self.u1 = self.u1.user_id | |
20 |
|
20 | |||
21 | self.u2 = UserModel().create_or_update(username=u'u2', |
|
21 | self.u2 = UserModel().create_or_update(username=u'u2', | |
22 | password=u'qweqwe', |
|
22 | password=u'qweqwe', | |
23 |
email=u'u2@ |
|
23 | email=u'u2@example.com', | |
24 | firstname=u'u2', lastname=u'u3') |
|
24 | firstname=u'u2', lastname=u'u3') | |
25 | Session().commit() |
|
25 | Session().commit() | |
26 | self.u2 = self.u2.user_id |
|
26 | self.u2 = self.u2.user_id | |
27 |
|
27 | |||
28 | self.u3 = UserModel().create_or_update(username=u'u3', |
|
28 | self.u3 = UserModel().create_or_update(username=u'u3', | |
29 | password=u'qweqwe', |
|
29 | password=u'qweqwe', | |
30 |
email=u'u3@ |
|
30 | email=u'u3@example.com', | |
31 | firstname=u'u3', lastname=u'u3') |
|
31 | firstname=u'u3', lastname=u'u3') | |
32 | Session().commit() |
|
32 | Session().commit() | |
33 | self.u3 = self.u3.user_id |
|
33 | self.u3 = self.u3.user_id |
@@ -29,20 +29,20 b' class TestPermissions(BaseTestCase):' | |||||
29 | def setUp(self): |
|
29 | def setUp(self): | |
30 | self.u1 = UserModel().create_or_update( |
|
30 | self.u1 = UserModel().create_or_update( | |
31 | username=u'u1', password=u'qweqwe', |
|
31 | username=u'u1', password=u'qweqwe', | |
32 |
email=u'u1@ |
|
32 | email=u'u1@example.com', firstname=u'u1', lastname=u'u1' | |
33 | ) |
|
33 | ) | |
34 | self.u2 = UserModel().create_or_update( |
|
34 | self.u2 = UserModel().create_or_update( | |
35 | username=u'u2', password=u'qweqwe', |
|
35 | username=u'u2', password=u'qweqwe', | |
36 |
email=u'u2@ |
|
36 | email=u'u2@example.com', firstname=u'u2', lastname=u'u2' | |
37 | ) |
|
37 | ) | |
38 | self.u3 = UserModel().create_or_update( |
|
38 | self.u3 = UserModel().create_or_update( | |
39 | username=u'u3', password=u'qweqwe', |
|
39 | username=u'u3', password=u'qweqwe', | |
40 |
email=u'u3@ |
|
40 | email=u'u3@example.com', firstname=u'u3', lastname=u'u3' | |
41 | ) |
|
41 | ) | |
42 | self.anon = User.get_default_user() |
|
42 | self.anon = User.get_default_user() | |
43 | self.a1 = UserModel().create_or_update( |
|
43 | self.a1 = UserModel().create_or_update( | |
44 | username=u'a1', password=u'qweqwe', |
|
44 | username=u'a1', password=u'qweqwe', | |
45 |
email=u'a1@ |
|
45 | email=u'a1@example.com', firstname=u'a1', lastname=u'a1', admin=True | |
46 | ) |
|
46 | ) | |
47 | Session().commit() |
|
47 | Session().commit() | |
48 |
|
48 |
@@ -22,7 +22,7 b' class TestUser(BaseTestCase):' | |||||
22 | def test_create_and_remove(self): |
|
22 | def test_create_and_remove(self): | |
23 | usr = UserModel().create_or_update(username=u'test_user', |
|
23 | usr = UserModel().create_or_update(username=u'test_user', | |
24 | password=u'qweqwe', |
|
24 | password=u'qweqwe', | |
25 |
email=u'u232@ |
|
25 | email=u'u232@example.com', | |
26 | firstname=u'u1', lastname=u'u1') |
|
26 | firstname=u'u1', lastname=u'u1') | |
27 | Session().commit() |
|
27 | Session().commit() | |
28 | self.assertEqual(User.get_by_username(u'test_user'), usr) |
|
28 | self.assertEqual(User.get_by_username(u'test_user'), usr) | |
@@ -44,13 +44,13 b' class TestUser(BaseTestCase):' | |||||
44 | def test_additonal_email_as_main(self): |
|
44 | def test_additonal_email_as_main(self): | |
45 | usr = UserModel().create_or_update(username=u'test_user', |
|
45 | usr = UserModel().create_or_update(username=u'test_user', | |
46 | password=u'qweqwe', |
|
46 | password=u'qweqwe', | |
47 |
email=u'main_email@ |
|
47 | email=u'main_email@example.com', | |
48 | firstname=u'u1', lastname=u'u1') |
|
48 | firstname=u'u1', lastname=u'u1') | |
49 | Session().commit() |
|
49 | Session().commit() | |
50 |
|
50 | |||
51 | def do(): |
|
51 | def do(): | |
52 | m = UserEmailMap() |
|
52 | m = UserEmailMap() | |
53 |
m.email = u'main_email@ |
|
53 | m.email = u'main_email@example.com' | |
54 | m.user = usr |
|
54 | m.user = usr | |
55 | Session().add(m) |
|
55 | Session().add(m) | |
56 | Session().commit() |
|
56 | Session().commit() | |
@@ -62,24 +62,24 b' class TestUser(BaseTestCase):' | |||||
62 | def test_extra_email_map(self): |
|
62 | def test_extra_email_map(self): | |
63 | usr = UserModel().create_or_update(username=u'test_user', |
|
63 | usr = UserModel().create_or_update(username=u'test_user', | |
64 | password=u'qweqwe', |
|
64 | password=u'qweqwe', | |
65 |
email=u'main_email@ |
|
65 | email=u'main_email@example.com', | |
66 | firstname=u'u1', lastname=u'u1') |
|
66 | firstname=u'u1', lastname=u'u1') | |
67 | Session().commit() |
|
67 | Session().commit() | |
68 |
|
68 | |||
69 | m = UserEmailMap() |
|
69 | m = UserEmailMap() | |
70 |
m.email = u'main_email2@ |
|
70 | m.email = u'main_email2@example.com' | |
71 | m.user = usr |
|
71 | m.user = usr | |
72 | Session().add(m) |
|
72 | Session().add(m) | |
73 | Session().commit() |
|
73 | Session().commit() | |
74 |
|
74 | |||
75 |
u = User.get_by_email(email='main_email@ |
|
75 | u = User.get_by_email(email='main_email@example.com') | |
76 | self.assertEqual(usr.user_id, u.user_id) |
|
76 | self.assertEqual(usr.user_id, u.user_id) | |
77 | self.assertEqual(usr.username, u.username) |
|
77 | self.assertEqual(usr.username, u.username) | |
78 |
|
78 | |||
79 |
u = User.get_by_email(email='main_email2@ |
|
79 | u = User.get_by_email(email='main_email2@example.com') | |
80 | self.assertEqual(usr.user_id, u.user_id) |
|
80 | self.assertEqual(usr.user_id, u.user_id) | |
81 | self.assertEqual(usr.username, u.username) |
|
81 | self.assertEqual(usr.username, u.username) | |
82 |
u = User.get_by_email(email='main_email3@ |
|
82 | u = User.get_by_email(email='main_email3@example.com') | |
83 | self.assertEqual(None, u) |
|
83 | self.assertEqual(None, u) | |
84 |
|
84 | |||
85 | UserModel().delete(usr.user_id) |
|
85 | UserModel().delete(usr.user_id) | |
@@ -94,7 +94,7 b' class TestUsers(BaseTestCase):' | |||||
94 | def setUp(self): |
|
94 | def setUp(self): | |
95 | self.u1 = UserModel().create_or_update(username=u'u1', |
|
95 | self.u1 = UserModel().create_or_update(username=u'u1', | |
96 | password=u'qweqwe', |
|
96 | password=u'qweqwe', | |
97 |
email=u'u1@ |
|
97 | email=u'u1@example.com', | |
98 | firstname=u'u1', lastname=u'u1') |
|
98 | firstname=u'u1', lastname=u'u1') | |
99 |
|
99 | |||
100 | def tearDown(self): |
|
100 | def tearDown(self): |
@@ -6,9 +6,9 b' API_KEY=`psql -R " " -A -U postgres -h l' | |||||
6 | echo "run those after running server" |
|
6 | echo "run those after running server" | |
7 | paster serve rc.ini --pid-file=rc.pid --daemon |
|
7 | paster serve rc.ini --pid-file=rc.pid --daemon | |
8 | sleep 3 |
|
8 | sleep 3 | |
9 |
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo1 password:qweqwe email:demo1@ |
|
9 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo1 password:qweqwe email:demo1@example.com | |
10 |
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo2 password:qweqwe email:demo2@ |
|
10 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo2 password:qweqwe email:demo2@example.com | |
11 |
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo3 password:qweqwe email:demo3@ |
|
11 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo3 password:qweqwe email:demo3@example.com | |
12 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user_group group_name:demo12 |
|
12 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user_group group_name:demo12 | |
13 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo1 |
|
13 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo1 | |
14 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo2 |
|
14 | rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo2 |
General Comments 0
You need to be logged in to leave comments.
Login now