+ let path = "test/xml/injuriesxml.xml"
+ actual <- unpickleable path pickle_message
+ let expected = True
+ actual @?= expected
+
+
+-- | Make sure everything gets deleted when we delete the top-level
+-- record.
+--
+test_on_delete_cascade :: TestTree
+test_on_delete_cascade =
+ testCase "deleting an injuries deletes its children" $ do
+ let path = "test/xml/injuriesxml.xml"
+ inj <- unsafe_unpickle path pickle_message
+ let a = undefined :: Injuries
+ let b = undefined :: InjuriesListing
+ actual <- withSqliteConn ":memory:" $ runDbConn $ do
+ runMigrationSilent $ do
+ migrate a
+ migrate b
+ _ <- dbimport inj
+ deleteAll a
+ count_a <- countAll a
+ count_b <- countAll b
+ return $ count_a + count_b
+ let expected = 0
+ actual @?= expected