Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TravelQ Destination Fields Revamp #1532

Merged
merged 32 commits into from
Mar 4, 2025
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0f3c42c
feat(templates): pd form help text;
JVickery-TBS Nov 8, 2024
d8e118c
feat(pd): travelq destination fields;
JVickery-TBS Nov 8, 2024
78c8026
feat(pd): travelq destination fields;
JVickery-TBS Nov 12, 2024
c04c09f
Merge branch 'master' into feature/travel-destination-fields
JVickery-TBS Nov 12, 2024
dc23230
feat(pd): travelq multi destinations;
JVickery-TBS Nov 12, 2024
e6cb543
fix(tests): type cast;
JVickery-TBS Nov 13, 2024
714425d
feat(pd): travelq excel;
JVickery-TBS Nov 13, 2024
2e97c17
feat(tests): travel destination formats;
JVickery-TBS Nov 14, 2024
b1f8284
fix(tests): postgres version;
JVickery-TBS Nov 14, 2024
a0814e4
feat(misc): changelog;
JVickery-TBS Nov 14, 2024
b24ef5a
fix(pd): multi-destination trigger;
JVickery-TBS Nov 15, 2024
46c230f
fix(pd): copy;
JVickery-TBS Nov 15, 2024
294385e
fix(pd): misc;
JVickery-TBS Nov 15, 2024
cd4ca94
fix(pd): travelq destination trigger error;
JVickery-TBS Nov 15, 2024
87bc151
fix(pd): order;
JVickery-TBS Nov 15, 2024
e51a724
fix(tests): travel destinations;
JVickery-TBS Nov 16, 2024
fc088a0
revert(pd): remove destination_3;
JVickery-TBS Nov 18, 2024
a264b0a
misc(stash): ugh;
JVickery-TBS Nov 22, 2024
a45e91e
feat(pd): travelq destination validation;
JVickery-TBS Nov 22, 2024
b37f16f
feat(pd): destination trigger;
JVickery-TBS Nov 22, 2024
c6d2325
feat(pd): travelq destination field text;
JVickery-TBS Nov 25, 2024
e7e7ae4
feat(tests): travelq;
JVickery-TBS Nov 25, 2024
1091e4e
feat(i18n,pd): travelq destination fields;
JVickery-TBS Nov 26, 2024
b5da6be
Merge branch 'master' into feature/travel-destination-fields
JVickery-TBS Jan 22, 2025
48df1f8
Merge branch 'master' into feature/travel-destination-fields
JVickery-TBS Feb 19, 2025
ceae8c7
feat(pd): travelq changes;
JVickery-TBS Feb 19, 2025
a17c221
fix(pd): example;
JVickery-TBS Feb 19, 2025
c13bfee
feat(pd): template warning;
JVickery-TBS Feb 19, 2025
4cfd2fe
feat(i18n): add string;
JVickery-TBS Feb 20, 2025
5dc69f2
fix(pd) start date excel;
JVickery-TBS Feb 20, 2025
ae729fc
feat(pd): travelq example values;
JVickery-TBS Feb 25, 2025
d979b37
fix(misc): syntax;
JVickery-TBS Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(tests): travel destinations;
- Use local countries file instead of an API.
JVickery-TBS committed Nov 16, 2024
commit e51a724fee9333d021eb47b0b1183d1104d69685
14 changes: 7 additions & 7 deletions ckanext/canada/tests/test_travelq.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: UTF-8 -*-
import requests
import os
import json
import random
from ckanext.canada.tests import CanadaTestBase
from ckanapi import LocalCKAN, ValidationError

@@ -10,7 +9,7 @@

from ckanext.recombinant.tables import get_chromo

DESTINATION_ENDPOINT = 'https://restcountries.com/v3.1/all?fields=name,capital'
COUNTRY_FILE = os.path.dirname(__file__) + '/../tables/choices/country.json'


class TestTravelQ(CanadaTestBase):
@@ -50,11 +49,12 @@ def test_blank(self):
def test_destination_format(self):
record = get_chromo('travelq')['examples']['record']

with open(COUNTRY_FILE) as f:
countries = json.load(f)

# tests correct formats
destinations = requests.get(DESTINATION_ENDPOINT, stream=True)
destinations = json.loads(destinations.content)
for destination in destinations:
_destination = (destination.get('capital', ['NaNd'])[0] if destination.get('capital') else 'NaNd').replace(',', '') + ', ' + destination.get('name', {}).get('common', 'NaNd').replace(',', '')
for _code, country_names in countries.items():
_destination = country_names['en'].replace(',', '') + ', ' + country_names['fr'].replace(',', '')
record['destination_en'] = _destination
record['destination_fr'] = _destination
record['destination_2_en'] = _destination