def test_ref_get_with_invalid_election_id_non_existent_election_id(self):
        response = self.client.get(
            reverse('results-export'),
            { 'election': '69' },
            HTTP_REFERER=reverse('results'),
            follow=True
        )

        messages = list(response.context['messages'])
        self.assertEqual(
            messages[0].message,
            'You specified an ID for a non-existent election.'
        )
        self.assertRedirects(response, reverse('results'))
def update_model(model, disc_grads, gen_grads, disc_opt, gen_opt,
                 global_step, update_scale):
  """Update model with gradients."""

  disc_vars, gen_vars = model.get_variables()

  with tf.control_dependencies(gen_grads + disc_grads):
    disc_update_op = disc_opt.apply_gradients(
        zip(_scale_vars(update_scale, disc_grads),
            disc_vars))

    gen_update_op = gen_opt.apply_gradients(
        zip(_scale_vars(update_scale, gen_grads),
            gen_vars),
        global_step=global_step)

    update_op = tf.group([disc_update_op, gen_update_op])

  return update_op