diff --git a/tests/multiple_database/tests.py b/tests/multiple_database/tests.py
index b1c0978..ee3efe7 100644
a
|
b
|
class MigrateTestCase(TestCase):
|
1956 | 1956 | router.routers = old_routers |
1957 | 1957 | |
1958 | 1958 | self.assertEqual(cts.count(), 0) |
| 1959 | |
| 1960 | |
| 1961 | class RouteForWriteTestCase(TestCase): |
| 1962 | multi_db = True |
| 1963 | |
| 1964 | def test_delete_fk(self): |
| 1965 | class Rtr(object): |
| 1966 | def db_for_write(self, model, **hints): |
| 1967 | raise AttributeError('Good') |
| 1968 | |
| 1969 | |
| 1970 | owner = Person.objects.create(name='Someone') |
| 1971 | try: |
| 1972 | old_rtrs = router.routers |
| 1973 | router.routers = [Rtr()] |
| 1974 | to_del_qs = owner.pet_set.all() |
| 1975 | to_del_qs.delete() |
| 1976 | self.fail('Should have attempted to re-route to write db') |
| 1977 | except AttributeError: |
| 1978 | pass |
| 1979 | finally: |
| 1980 | router.routers = old_rtrs |