                errors))))))
 
 (deftest retrieve-variable-by-concept-id-umm-json-accept-header
-  (let [var1-name "variable1"
-        var1-name-new "variable1-new"
-        var1-v1 (variable/ingest-variable-with-attrs {:Name var1-name})
-        _ (index/wait-until-indexed)
-        var1-v2 (variable/ingest-variable-with-attrs
-                 {:Name var1-name-new
-                  :native-id (:native-id var1-v1)})
+  (let [var1-v1 (get-var var1-name)
+        var1-v2 (get-updated-var var1-v1 {:Name var1-name-new})
         ;; tokens
-        guest-token (e/login-guest (s/context))
-        user1-token (e/login (s/context) "user1")
-
+        [guest-token user1-token] (get-tokens)
+        ;; responses
         response (search/retrieve-concept
                   (:concept-id var1-v1)
                   nil


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Retrieve by concept-id - general test
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(deftest retrieve-variable-by-concept-id-any-accept-header
  (let [var1-name "variable1"
        var1-v1 (variable/ingest-variable-with-attrs {:Name var1-name})
        del-var (variable/ingest-variable-with-attrs {:Name "deleted-variable"})
        _ (index/wait-until-indexed)
        del-concept (mdb/get-concept (:concept-id del-var))
        ;; tokens
        guest-token (e/login-guest (s/context))
        user1-token (e/login (s/context) "user1")]
    (ingest/delete-concept del-concept (variable/token-opts user1-token))
    (index/wait-until-indexed)
    (testing "retrieval of a deleted variable results in a 404"

        (is (= [(format "Concept with concept-id [%s] could not be found."
                        (:concept-id del-var))]
               errors))))
    (let [var1-v2 (get-updated-var var1-v1 {:Name var1-name-new})]
      (testing (str "Sanity check that the test variable got updated and its "
                    "revision id was incremented.")
        (is (= 2
