280 | | management.call_command( |
281 | | 'loaddata', |
282 | | 'animal.xml', |
283 | | verbosity=0, |
284 | | commit=False, |
285 | | ) |
286 | | self.assertEqual( |
287 | | pre_save_checks, |
288 | | [ |
289 | | ("Count = 42 (<type 'int'>)", "Weight = 1.2 (<type 'float'>)") |
290 | | ] |
291 | | ) |
292 | | signals.pre_save.disconnect(animal_pre_save_check) |
| 280 | try: |
| 281 | management.call_command( |
| 282 | 'loaddata', |
| 283 | 'animal.xml', |
| 284 | verbosity=0, |
| 285 | commit=False, |
| 286 | ) |
| 287 | self.assertEqual( |
| 288 | pre_save_checks, |
| 289 | [ |
| 290 | ("Count = 42 (<type 'int'>)", "Weight = 1.2 (<type 'float'>)") |
| 291 | ] |
| 292 | ) |
| 293 | finally: |
| 294 | signals.pre_save.disconnect(animal_pre_save_check) |