mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-21 23:44:30 +00:00
Fix backend tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
9621caf661
commit
b383d11f51
7 changed files with 13 additions and 2 deletions
|
@ -496,7 +496,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
|
|||
physical_address when is_map(physical_address) ->
|
||||
TimezoneDetector.detect(
|
||||
timezone,
|
||||
physical_address.geom,
|
||||
Map.get(physical_address, :geom),
|
||||
fallback_tz
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,9 @@ defmodule Mobilizon.Service.TimezoneDetector do
|
|||
@doc """
|
||||
Detect the most appropriate timezone from a value, a geographic set of coordinates and a fallback
|
||||
"""
|
||||
@spec detect(String.t() | nil, detectable(), String.t()) :: String.t()
|
||||
@spec detect(String.t() | nil, detectable() | nil, String.t()) :: String.t()
|
||||
def detect(tz, nil, fallback), do: detect(tz, fallback)
|
||||
|
||||
def detect(nil, geo, fallback) do
|
||||
case TzWorld.timezone_at(geo) do
|
||||
{:ok, timezone} ->
|
||||
|
|
|
@ -28,6 +28,7 @@ defmodule Mobilizon.Service.Geospatial.AddokTest do
|
|||
region: "69, Rhône, Auvergne-Rhône-Alpes",
|
||||
locality: "Lyon",
|
||||
description: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
geom: %Geo.Point{coordinates: {4.842569, 45.751718}, properties: %{}, srid: 4326}
|
||||
|
@ -54,6 +55,7 @@ defmodule Mobilizon.Service.Geospatial.AddokTest do
|
|||
region: "69, Rhône, Auvergne-Rhône-Alpes",
|
||||
locality: "Lyon",
|
||||
description: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
geom: %Geo.Point{coordinates: {4.842569, 45.751718}, properties: %{}, srid: 4326}
|
||||
|
|
|
@ -69,6 +69,7 @@ defmodule Mobilizon.Service.Geospatial.GoogleMapsTest do
|
|||
country: "France",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.8424032, 45.75164940000001},
|
||||
properties: %{},
|
||||
|
@ -116,6 +117,7 @@ defmodule Mobilizon.Service.Geospatial.GoogleMapsTest do
|
|||
country: "France",
|
||||
postal_code: "69007",
|
||||
street: "10bis Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.8424966, 45.751725},
|
||||
properties: %{},
|
||||
|
|
|
@ -55,6 +55,7 @@ defmodule Mobilizon.Service.Geospatial.MapQuestTest do
|
|||
country: "FR",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.842566, 45.751714},
|
||||
properties: %{},
|
||||
|
@ -88,6 +89,7 @@ defmodule Mobilizon.Service.Geospatial.MapQuestTest do
|
|||
country: "FR",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.842569, 45.751718},
|
||||
properties: %{},
|
||||
|
|
|
@ -31,6 +31,7 @@ defmodule Mobilizon.Service.Geospatial.NominatimTest do
|
|||
country: "France",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.8425657, 45.7517141},
|
||||
properties: %{},
|
||||
|
@ -66,6 +67,7 @@ defmodule Mobilizon.Service.Geospatial.NominatimTest do
|
|||
country: "France",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.8425657, 45.7517141},
|
||||
properties: %{},
|
||||
|
|
|
@ -30,6 +30,7 @@ defmodule Mobilizon.Service.Geospatial.PhotonTest do
|
|||
country: "France",
|
||||
postal_code: "69007",
|
||||
street: "10 Rue Jangot",
|
||||
timezone: "Europe/Paris",
|
||||
geom: %Geo.Point{
|
||||
coordinates: {4.8425657, 45.7517141},
|
||||
properties: %{},
|
||||
|
|
Loading…
Reference in a new issue