diff options
author | lain <lain@soykaf.club> | 2020-05-06 11:44:30 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-06 11:44:30 +0200 |
commit | 205313e54146c00374e3edfa951132a7229fa16d (patch) | |
tree | db392c5ef71a2a40fb8a041635d2536b34dc454d /test/support/helpers.ex | |
parent | 9637cded21cef1e6c531dd46d5f5245c4c3ed03c (diff) | |
parent | 07e7c80bc9e919cd92ca9dda1e21384142e5bd77 (diff) | |
download | pleroma-205313e54146c00374e3edfa951132a7229fa16d.tar.gz pleroma-205313e54146c00374e3edfa951132a7229fa16d.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/support/helpers.ex')
-rw-r--r-- | test/support/helpers.ex | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/support/helpers.ex b/test/support/helpers.ex index e68e9bfd2..26281b45e 100644 --- a/test/support/helpers.ex +++ b/test/support/helpers.ex @@ -40,12 +40,18 @@ defmodule Pleroma.Tests.Helpers do clear_config: 2 ] - def to_datetime(naive_datetime) do + def to_datetime(%NaiveDateTime{} = naive_datetime) do naive_datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.truncate(:second) end + def to_datetime(datetime) when is_binary(datetime) do + datetime + |> NaiveDateTime.from_iso8601!() + |> to_datetime() + end + def collect_ids(collection) do collection |> Enum.map(& &1.id) |