• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OCHA-DAP / hdx-ckan / #5319

23 May 2024 03:08PM UTC coverage: 71.911% (+0.005%) from 71.906%
#5319

Pull #6327

coveralls-python

ccataalin
HDX-9822 HAPI landing page
Pull Request #6327: HDX-9822 HAPI landing page

27 of 36 new or added lines in 6 files covered. (75.0%)

11761 of 16355 relevant lines covered (71.91%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.38
/ckanext-hdx_theme/ckanext/hdx_theme/views/landing_pages.py
1
import logging
1✔
2
import flask
1✔
3
import ckan.plugins.toolkit as tk
1✔
4
import ckanext.hdx_theme.helpers.faq_wordpress as fw
1✔
5
from ckan.common import config
1✔
6
from ckanext.hdx_theme.helpers.ui_constants.landing_pages.hapi import DATA_COVERAGE_CONSTANTS, SECTIONS_CONSTANTS
1✔
7

8
abort = tk.abort
1✔
9
g = tk.g
1✔
10
check_access = tk.check_access
1✔
11
get_action = tk.get_action
1✔
12
render = tk.render
1✔
13

14
log = logging.getLogger(__name__)
1✔
15

16
hdx_landing_pages = flask.Blueprint(u'hdx_landing_pages', __name__, url_prefix=u'/')
1✔
17

18

19
def hapi():
1✔
NEW
20
    wp_category_terms = config.get('hdx.wordpress.category.hapi')
×
NEW
21
    data = fw.faq_for_category(wp_category_terms)
×
22

NEW
23
    partners = [
×
24
        ('acled', 'ACLED'),
25
        ('european_comission', 'European Commission'),
26
        ('inform', 'INFORM'),
27
        ('ipc', 'IPC'),
28
        ('ocha', 'OCHA'),
29
        ('ophi', 'OPHI'),
30
        ('unchr', 'UNHCR'),
31
        ('unfpa', 'UNFPA'),
32
        ('wfp', 'WFP')
33
    ]
NEW
34
    sections = SECTIONS_CONSTANTS
×
NEW
35
    data_coverage = DATA_COVERAGE_CONSTANTS
×
36

NEW
37
    template_data = {
×
38
        'partners': partners,
39
        'sections': sections,
40
        'data_coverage': data_coverage,
41
        'faq_data': data['faq_data'],
42
    }
43

NEW
44
    return render('landing_pages/hapi.html', extra_vars=template_data)
×
45

46

47
def signals():
1✔
NEW
48
    template_data = {}
×
49

NEW
50
    return render('landing_pages/signals.html', extra_vars=template_data)
×
51

52

53
hdx_landing_pages.add_url_rule(u'/hapi/', view_func=hapi, strict_slashes=False)
1✔
54
hdx_landing_pages.add_url_rule(u'/signals/', view_func=signals, strict_slashes=False)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc