Ejemplo n.º 1
0
    def test_get_elections_to_contribute(self):
        """ Test the get_elections_to_contribute function. """
        create_elections(self.session)

        elections = nuancierlib.get_elections_to_contribute(self.session)
        self.assertEqual(1, len(elections))
        self.assertEqual('Wallpaper F21', elections[0].election_name)
Ejemplo n.º 2
0
    def test_get_elections_to_contribute(self):
        """ Test the get_elections_to_contribute function. """
        create_elections(self.session)

        elections = nuancierlib.get_elections_to_contribute(self.session)
        self.assertEqual(1, len(elections))
        self.assertEqual('Wallpaper F21', elections[0].election_name)
Ejemplo n.º 3
0
def index():
    ''' Display the index page. '''
    elections = nuancierlib.get_elections_open(SESSION)
    contributions = nuancierlib.get_elections_to_contribute(SESSION)
    published = nuancierlib.get_elections_public(SESSION)
    election = election_results = None
    if published:
        election = published[0]
        election_results = nuancierlib.get_results(SESSION, election.id)
    return flask.render_template('index.html',
                                 elections=elections,
                                 election=election,
                                 results=election_results,
                                 contributions=contributions)
Ejemplo n.º 4
0
def index():
    ''' Display the index page. '''
    elections = nuancierlib.get_elections_open(SESSION)
    contributions = nuancierlib.get_elections_to_contribute(SESSION)
    published = nuancierlib.get_elections_public(SESSION)
    election = election_results = None
    if published:
        election = published[0]
        election_results = nuancierlib.get_results(SESSION, election.id)
    return flask.render_template(
        'index.html',
        elections=elections,
        election=election,
        results=election_results,
        contributions=contributions)
Ejemplo n.º 5
0
def contribute_index():
    ''' Display the index page for interested contributor. '''
    elections = nuancierlib.get_elections_to_contribute(SESSION)
    return flask.render_template('contribute_index.html', elections=elections)
Ejemplo n.º 6
0
def contribute_index():
    ''' Display the index page for interested contributor. '''
    elections = nuancierlib.get_elections_to_contribute(SESSION)
    return flask.render_template(
        'contribute_index.html',
        elections=elections)