|
12 | 12 | from time_machine import travel |
13 | 13 |
|
14 | 14 | from fittrackee import db |
| 15 | +from fittrackee.constants import MissingElevationsProcessing |
15 | 16 | from fittrackee.equipments.models import Equipment |
16 | 17 | from fittrackee.files import get_absolute_file_path |
17 | 18 | from fittrackee.reports.models import ReportAction |
@@ -311,6 +312,32 @@ def test_it_does_return_reports_info_when_user_has_admin_rights( |
311 | 312 | assert serialized_user["reported_count"] == 0 |
312 | 313 | assert serialized_user["sanctions_count"] == 0 |
313 | 314 |
|
| 315 | + def test_it_returns_missing_elevations_processing_when_no_elevation_service_set( # noqa |
| 316 | + self, app: Flask, user_1: User |
| 317 | + ) -> None: |
| 318 | + user_1.missing_elevations_processing = ( |
| 319 | + MissingElevationsProcessing.OPEN_ELEVATION |
| 320 | + ) |
| 321 | + serialized_user = user_1.serialize(current_user=user_1, light=False) |
| 322 | + |
| 323 | + assert ( |
| 324 | + serialized_user["missing_elevations_processing"] |
| 325 | + == MissingElevationsProcessing.NONE |
| 326 | + ) |
| 327 | + |
| 328 | + def test_it_returns_missing_elevations_processing_when_elevation_service_set( # noqa |
| 329 | + self, app_with_open_elevation_url: Flask, user_1: User |
| 330 | + ) -> None: |
| 331 | + user_1.missing_elevations_processing = ( |
| 332 | + MissingElevationsProcessing.OPEN_ELEVATION_SMOOTH |
| 333 | + ) |
| 334 | + serialized_user = user_1.serialize(current_user=user_1, light=False) |
| 335 | + |
| 336 | + assert ( |
| 337 | + serialized_user["missing_elevations_processing"] |
| 338 | + == user_1.missing_elevations_processing |
| 339 | + ) |
| 340 | + |
314 | 341 |
|
315 | 342 | class TestUserSerializeAsAdmin(UserModelAssertMixin, ReportMixin): |
316 | 343 | def test_it_returns_user_account_infos( |
|
0 commit comments