(cls)
| 65 | class TestSQLTranslator(unittest.TestCase): |
| 66 | @classmethod |
| 67 | def setUpClass(cls): |
| 68 | setup_database(db) |
| 69 | with db_session: |
| 70 | d1 = Department(number=44) |
| 71 | d2 = Department(number=43) |
| 72 | g1 = Group(id=1, dept=d1) |
| 73 | g2 = Group(id=2, dept=d2) |
| 74 | s1 = Student(id=1, name='S1', group=g1, scholarship=0, picture=b'image') |
| 75 | s2 = Student(id=2, name='S2', group=g1, scholarship=100) |
| 76 | s3 = Student(id=3, name='S3', group=g2, scholarship=500) |
| 77 | c1 = Course(name='Math', semester=1, dept=d1) |
| 78 | c2 = Course(name='Economics', semester=1, dept=d1, credits=3) |
| 79 | c3 = Course(name='Physics', semester=2, dept=d2) |
| 80 | t1 = Teacher(id=101, name="T1") |
| 81 | t2 = Teacher(id=102, name="T2") |
| 82 | Grade(student=s1, course=c1, value='C', teacher=t2, date=date(2011, 1, 1)) |
| 83 | Grade(student=s1, course=c3, value='A', teacher=t1, date=date(2011, 2, 1)) |
| 84 | Grade(student=s2, course=c2, value='B', teacher=t1) |
| 85 | r1 = Room(name='Room1') |
| 86 | r2 = Room(name='Room2') |
| 87 | r3 = Room(name='Room3') |
| 88 | g1.rooms = [r1, r2] |
| 89 | g2.rooms = [r2, r3] |
| 90 | c1.students.add(s1) |
| 91 | c1.students.add(s2) |
| 92 | c2.students.add(s2) |
| 93 | setup_database(db2) |
| 94 | @classmethod |
| 95 | def tearDownClass(cls): |
| 96 | teardown_database(db) |
nothing calls this directly
no test coverage detected