| 477 | |
| 478 | @classmethod |
| 479 | def insert_data(cls, connection): |
| 480 | cattable, matchtable = cls.tables("cattable", "matchtable") |
| 481 | |
| 482 | connection.execute( |
| 483 | cattable.insert(), |
| 484 | [ |
| 485 | {"id": 1, "description": "Python"}, |
| 486 | {"id": 2, "description": "Ruby"}, |
| 487 | ], |
| 488 | ) |
| 489 | connection.execute( |
| 490 | matchtable.insert(), |
| 491 | [ |
| 492 | { |
| 493 | "id": 1, |
| 494 | "title": "Web Development with Rails", |
| 495 | "category_id": 2, |
| 496 | }, |
| 497 | {"id": 2, "title": "Dive Into Python", "category_id": 1}, |
| 498 | { |
| 499 | "id": 3, |
| 500 | "title": "Programming Matz's Ruby", |
| 501 | "category_id": 2, |
| 502 | }, |
| 503 | {"id": 4, "title": "Guide to Django", "category_id": 1}, |
| 504 | {"id": 5, "title": "Python in a Nutshell", "category_id": 1}, |
| 505 | ], |
| 506 | ) |
| 507 | # apparently this is needed! index must run asynchronously |
| 508 | connection.execute(DDL("WAITFOR DELAY '00:00:05'")) |
| 509 | |
| 510 | def test_expression(self): |
| 511 | matchtable = self.tables.matchtable |