 
       (summarize-and-store (u/to-ISO-8601 start-day) (u/to-ISO-8601 end-day))
       
-      (let [summaries (select usage-summaries)]
+      (let [summaries (select usage_summaries)]
         (is (= [
           {:disk-GB {:unit_minutes 144720.0}, :RAM-GB {:unit_minutes 11520.0}, :nb-cpu {:unit_minutes 2880.0}}] 
           (map (comp u/deserialize :usage) (filter #(= "joe" (:user %)) summaries))))


(defn check-summaries
  []  
  (doseq [summary (select usage-summaries)]    
    (if (= "exoscale-ch-gva"  (:cloud summary))
      (do
        (is (= "joe"              (:user summary)))


      (summarize-and-store (u/to-ISO-8601 (t/minus start-day (t/days 1))) (u/to-ISO-8601 end-day))
      
      (let [summaries (select usage_summaries)]
        (is (= [{:disk-GB {:unit_minutes 144720.0}, :RAM-GB {:unit_minutes 11520.0}, :nb-cpu {:unit_minutes 2880.0}}] 
          (map (comp u/deserialize :usage) (select usage_summaries)))))))



