| 491 | |
| 492 | @classmethod |
| 493 | def insert_data(cls, connection): |
| 494 | cattable, matchtable = cls.tables("cattable", "matchtable") |
| 495 | |
| 496 | connection.execute( |
| 497 | cattable.insert(), |
| 498 | [ |
| 499 | {"id": 1, "description": "Python"}, |
| 500 | {"id": 2, "description": "Ruby"}, |
| 501 | ], |
| 502 | ) |
| 503 | connection.execute( |
| 504 | matchtable.insert(), |
| 505 | [ |
| 506 | { |
| 507 | "id": 1, |
| 508 | "title": "Web Development with Rails", |
| 509 | "category_id": 2, |
| 510 | }, |
| 511 | {"id": 2, "title": "Dive Into Python", "category_id": 1}, |
| 512 | { |
| 513 | "id": 3, |
| 514 | "title": "Programming Matz's Ruby", |
| 515 | "category_id": 2, |
| 516 | }, |
| 517 | {"id": 4, "title": "Guide to Django", "category_id": 1}, |
| 518 | {"id": 5, "title": "Python in a Nutshell", "category_id": 1}, |
| 519 | ], |
| 520 | ) |
| 521 | # apparently this is needed! index must run asynchronously |
| 522 | connection.execute(DDL("WAITFOR DELAY '00:00:05'")) |
| 523 | |
| 524 | def test_expression(self): |
| 525 | matchtable = self.tables.matchtable |