     (is (validation/has-error? transaction :items))))
 
 (deftest item-amount-is-required
-  (let [transaction (transactions/create
+  (let [context (test-context)
+        attributes (:attributes context)
+        transaction (transactions/create
                       storage-spec
                       (update-in attributes
                                  [:items 0]

    (is (validation/has-error? transaction :items) "Validation error should be present")))

(deftest item-action-must-be-debit-or-created
  (let [transaction (transactions/create
                      storage-spec
                      (update-in attributes
                                 [:items 0]

               (count (:items retrieved))) "The items are returned with the transaction")))))

(deftest transaction-date-is-required
  (let [context (test-context)
        attributes (:attributes context)
        transaction (transactions/create storage-spec (dissoc attributes :transaction-date))]
    (is (validation/has-error? transaction :transaction-date))))

(deftest entity-id-is-required
  (let [context (test-context)
        attributes (:attributes context)
        transaction (transactions/create storage-spec (dissoc attributes :entity-id))]
    (is (validation/has-error? transaction :entity-id))))

(deftest item-account-id-is-required
  (let [context (test-context)
        attributes (:attributes context)
        transaction (transactions/create
                      storage-spec
                      (update-in attributes
                                 [:items 0]
