Mercurial > p > roundup > code
comparison test/db_test_base.py @ 5235:9886917c8545
Add more sleeps to work around mysql timestamp issue.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 15 Apr 2017 17:39:19 -0400 |
| parents | d8457c376a38 |
| children | 198b6e810c67 |
comparison
equal
deleted
inserted
replaced
| 5234:d8457c376a38 | 5235:9886917c8545 |
|---|---|
| 1107 | 1107 |
| 1108 # Change the role for the new_user. | 1108 # Change the role for the new_user. |
| 1109 # If journal is retrieved by admin this adds the role | 1109 # If journal is retrieved by admin this adds the role |
| 1110 # change as the last element. If retreived by non-admin | 1110 # change as the last element. If retreived by non-admin |
| 1111 # it should not be returned because the user has no | 1111 # it should not be returned because the user has no |
| 1112 # View permissons on role.. | 1112 # View permissons on role. |
| 1113 # FIXME delay by two seconds due to mysql missing | |
| 1114 # fractional seconds. See sleep above for details | |
| 1115 time.sleep(2) | |
| 1113 result=self.db.user.set(new_user, roles="foo, bar") | 1116 result=self.db.user.set(new_user, roles="foo, bar") |
| 1114 | 1117 |
| 1115 # Verify last journal entry as admin is a role change | 1118 # Verify last journal entry as admin is a role change |
| 1116 # from None | 1119 # from None |
| 1117 result=self.db.user.history(new_user, skipquiet=False) | 1120 result=self.db.user.history(new_user, skipquiet=False) |
| 1128 ('issue', '1', 'nosy')), | 1131 ('issue', '1', 'nosy')), |
| 1129 ('3', <Date 2017-04-15.02:06:11.482>, '1', 'set', | 1132 ('3', <Date 2017-04-15.02:06:11.482>, '1', 'set', |
| 1130 {'roles': None})] | 1133 {'roles': None})] |
| 1131 ''' | 1134 ''' |
| 1132 (id, tx_date, user, action, args) = result[-1] | 1135 (id, tx_date, user, action, args) = result[-1] |
| 1133 expected= {'roles': None } | 1136 expected = {'roles': None } |
| 1134 | 1137 |
| 1135 self.assertEqual('3', id) | 1138 self.assertEqual('3', id) |
| 1136 self.assertEqual('1', user) | 1139 self.assertEqual('1', user) |
| 1137 self.assertEqual('set', action) | 1140 self.assertEqual('set', action) |
| 1138 self.assertEqual(expected, args) | 1141 self.assertEqual(expected, args) |
| 1141 # view some props of the user class (search backwards | 1144 # view some props of the user class (search backwards |
| 1142 # for QuietJournal to see the properties, they should be: | 1145 # for QuietJournal to see the properties, they should be: |
| 1143 # 'username', 'supervisor', 'assignable' i.e. age is not | 1146 # 'username', 'supervisor', 'assignable' i.e. age is not |
| 1144 # one of them. | 1147 # one of them. |
| 1145 id = self.db.user.lookup("fred") | 1148 id = self.db.user.lookup("fred") |
| 1149 # FIXME mysql timestamp issue see sleeps above | |
| 1150 time.sleep(2) | |
| 1146 result=self.db.user.set(id, roles="User") | 1151 result=self.db.user.set(id, roles="User") |
| 1147 # make the user fred current. | 1152 # make the user fred current. |
| 1148 self.db.setCurrentUser('fred') | 1153 self.db.setCurrentUser('fred') |
| 1149 self.assertEqual(self.db.getuid(), id) | 1154 self.assertEqual(self.db.getuid(), id) |
| 1150 | 1155 |
