making tests work again.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
[auto-ap.datomic :refer [conn]]
|
||||
[auto-ap.import.transactions :as sut]
|
||||
[auto-ap.integration.util :refer [wrap-setup]]
|
||||
[iol-ion.tx :refer [upsert-transaction]]
|
||||
[iol-ion.tx.upsert-transaction :refer [upsert-transaction]]
|
||||
[datomic.api :as dc]
|
||||
[clj-time.coerce :as coerce]
|
||||
[clojure.test :as t]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require
|
||||
[auto-ap.datomic :refer [conn pull-attr]]
|
||||
[auto-ap.ledger :as sut]
|
||||
[iol-ion.tx :refer [upsert-ledger]]
|
||||
[iol-ion.tx.upsert-ledger :refer [upsert-ledger]]
|
||||
[auto-ap.integration.util :refer [wrap-setup]]
|
||||
[clojure.test :as t :refer [deftest is testing use-fixtures]]
|
||||
[datomic.api :as d]))
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
(ns auto-ap.integration.util
|
||||
(:require [datomic.api :as dc]
|
||||
[auto-ap.datomic :refer [client conn transact-schema]]
|
||||
[auto-ap.datomic :refer [conn transact-schema]]
|
||||
[clj-time.core :as time]))
|
||||
|
||||
(defn wrap-setup
|
||||
[f]
|
||||
(require 'datomic.dev-local)
|
||||
(with-redefs [auto-ap.datomic/client (dc/client {:server-type :dev-local
|
||||
:system "test"})]
|
||||
(dc/create-database client {:db-name "test"})
|
||||
(with-redefs [auto-ap.datomic/conn (dc/connect client {:db-name "test"})]
|
||||
(with-redefs [auto-ap.datomic/uri "datomic:mem://test"]
|
||||
(dc/create-database auto-ap.datomic/uri)
|
||||
(with-redefs [auto-ap.datomic/conn auto-ap.datomic/uri]
|
||||
(transact-schema conn)
|
||||
(f)
|
||||
(dc/delete-database client {:db-name "test"}))))
|
||||
(dc/delete-database auto-ap.datomic/uri))))
|
||||
|
||||
(defn admin-token []
|
||||
{:user "TEST ADMIN"
|
||||
|
||||
@@ -61,10 +61,10 @@
|
||||
:customer-identifier "ABC"
|
||||
:invoice-number "789")])
|
||||
(t/is (= [["DE"]] (dc/q '[:find ?l
|
||||
:where [?i :invoice/invoice-number "789"]
|
||||
[?i :invoice/expense-accounts ?ea]
|
||||
[?ea :invoice-expense-account/location ?l]
|
||||
(dc/db conn)))))
|
||||
:where [?i :invoice/invoice-number "789"]
|
||||
[?i :invoice/expense-accounts ?ea]
|
||||
[?ea :invoice-expense-account/location ?l]]
|
||||
(dc/db conn)))))
|
||||
|
||||
(t/testing "Should code invoice"
|
||||
(let [{{:strs [my-default-account coded-vendor]} :tempids} (dc/transact conn
|
||||
|
||||
Reference in New Issue
Block a user