Mercurial > p > roundup > code
comparison test/test_mysql.py @ 7206:521d98231e5c
Test self.db.db_version_updated in schema upgrade paths
A user on the roundup-users mailing list reported that a
'roundup-admin migrate' reported that changes were needed. But it
should have done the migration.
roundup-admin uses the property db.db_version_updated to tell if there
was a migration. Testing never looked at that property. Add a test for
that property in all migration updates.
AFAICT the test is always successful. So no bug uncovered by these
tests.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 02 Mar 2023 17:01:39 -0500 |
| parents | bdd28b244839 |
| children |
comparison
equal
deleted
inserted
replaced
| 7205:1a3d4703c7d6 | 7206:521d98231e5c |
|---|---|
| 110 return | 110 return |
| 111 | 111 |
| 112 # test upgrade altering row | 112 # test upgrade altering row |
| 113 self.db.post_init() | 113 self.db.post_init() |
| 114 | 114 |
| 115 self.assertEqual(self.db.db_version_updated, True) | |
| 116 | |
| 115 # This insert with text of expected column size should succeed | 117 # This insert with text of expected column size should succeed |
| 116 self.db.sql("insert into __words VALUES('%s',1)" % long_string) | 118 self.db.sql("insert into __words VALUES('%s',1)" % long_string) |
| 117 | 119 |
| 118 # Verify it fails at one more than the expected column size | 120 # Verify it fails at one more than the expected column size |
| 119 too_long_string = "a" * (self.db.indexer.maxlength + 6) | 121 too_long_string = "a" * (self.db.indexer.maxlength + 6) |
| 163 return | 165 return |
| 164 | 166 |
| 165 # test upgrade | 167 # test upgrade |
| 166 self.db.post_init() | 168 self.db.post_init() |
| 167 | 169 |
| 170 self.assertEqual(self.db.db_version_updated, True) | |
| 171 | |
| 168 # verify they keep all signifcant digits before the decimal point | 172 # verify they keep all signifcant digits before the decimal point |
| 169 for tablename in ['otk', 'session']: | 173 for tablename in ['otk', 'session']: |
| 170 self.db.sql( | 174 self.db.sql( |
| 171 'insert %(name)ss(%(name)s_key, %(name)s_time, %(name)s_value) ' | 175 'insert %(name)ss(%(name)s_key, %(name)s_time, %(name)s_value) ' |
| 172 'values("foo", %(double)s, "value");'%{'name': tablename, | 176 'values("foo", %(double)s, "value");'%{'name': tablename, |
