diff options
author | lain <lain@soykaf.club> | 2020-05-16 17:07:09 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-16 17:07:09 +0000 |
commit | d15aa9d9503e59b3cd0731394855781f435ec63c (patch) | |
tree | 844810415def046a2fc886d0bc1baeb1ff9afb21 /test/support/helpers.ex | |
parent | 9cf4c4fa73e68f03791c5cc70505b710be39b677 (diff) | |
parent | 3bc1138dd9beec03d2336fa1ad45dd23816f5285 (diff) | |
download | pleroma-d15aa9d9503e59b3cd0731394855781f435ec63c.tar.gz |
Merge branch 'develop' into 'remove-twitter-api'
# Conflicts:
# lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
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) |