API - init privacy policy
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
from flask import Flask
|
||||
|
||||
@ -5,6 +7,8 @@ from fittrackee import VERSION
|
||||
from fittrackee.application.models import AppConfig
|
||||
from fittrackee.users.models import User
|
||||
|
||||
from ..utils import random_string
|
||||
|
||||
|
||||
class TestConfigModel:
|
||||
def test_application_config(
|
||||
@ -88,3 +92,26 @@ class TestConfigModel:
|
||||
serialized_app_config['weather_provider']
|
||||
== expected_weather_provider
|
||||
)
|
||||
|
||||
def test_it_returns_privacy_policy(self, app: Flask) -> None:
|
||||
app_config = AppConfig.query.first()
|
||||
privacy_policy = random_string()
|
||||
privacy_policy_date = datetime.now()
|
||||
app_config.privacy_policy = privacy_policy
|
||||
app_config.privacy_policy_date = privacy_policy_date
|
||||
|
||||
serialized_app_config = app_config.serialize()
|
||||
|
||||
assert serialized_app_config["privacy_policy"] == privacy_policy
|
||||
assert (
|
||||
serialized_app_config["privacy_policy_date"] == privacy_policy_date
|
||||
)
|
||||
|
||||
def test_it_returns_about(self, app: Flask) -> None:
|
||||
app_config = AppConfig.query.first()
|
||||
about = random_string()
|
||||
app_config.about = about
|
||||
|
||||
serialized_app_config = app_config.serialize()
|
||||
|
||||
assert serialized_app_config["about"] == about
|
||||
|
Reference in New Issue
Block a user