                          :amount 13M
                          :balance 13M}]
         actual-items (map #(select-keys % [:index :amount :balance])
-                          (transactions/items-by-account storage-spec (:id pets)))]
+                          (items-by-account (:id pets)))]
     (testing "item values are correct"
+      (when-not (= expected-items actual-items)
+        (pprint {:expected expected-items
+                 :actual actual-items
+                 :diff (diff expected-items actual-items)}))
       (is (= expected-items actual-items)
           "The Pets account should have the correct items"))
     (testing "account balances are correct"

  (let [context (serialization/realize storage-spec balance-context)
        [checking-items
         salary-items
         groceries-items] (map #(transactions/items-by-account
                                  storage-spec
                                  (:id %)
                                  [(t/local-date 2016 1 1) (t/local-date 2016 12 31)])
                               (:accounts context))]
    (is (= [1 0] (map :index checking-items)) "The checking transaction items have correct indexes")
    (is (= [0] (map :index salary-items)) "The salary transaction items have the correct indexes")

        [t1 t2 t3 t4] (:transactions context)
        updated (assoc t3 :transaction-date (t/local-date 2016 3 8))
        update-calls (atom {})]
    (with-redefs [transactions/update-item-index-and-balance (partial fake-update-item-index-and-balance
                                                                      context
                                                                      update-calls)]
      (transactions/update storage-spec updated)
      (let [expected #{{:index 2
                       :amount 101M
