Did I find the right examples for you? yes no

All Samples(19)  |  Call(19)  |  Derive(0)  |  Import(0)

src/v/o/votainteligente-portal-electoral-HEAD/elections/management/commands/photo_loader.py   votainteligente-portal-electoral(Download)
            candidate_name = line[0].decode('utf-8').strip()
            try:
                candidate = Candidate.objects.get(name=candidate_name)
                photo_url = prepended_url + line[1].decode('utf-8').strip()
                candidate.photo = photo_url

src/c/a/candideitorg-django-0.0.1/candideitorg/tests.py   candideitorg-django(Download)
 
 
        tester = Candidate.objects.get(resource_uri='/api/v2/candidate/2/')
        information_source2 = InformationSource.objects.get(Q(question=paros) & Q(candidate=tester))
        self.assertEquals(information_source2.content, u'this IS did not exist before')
    def test_pull_from_api_and_relates(self):
        Election.fetch_all_from_api()
 
        candidate = Candidate.objects.get(resource_uri="/api/v2/candidate/1/")
        question = Question.objects.get(resource_uri="/api/v2/question/1/")
    def test_associate_answers(self):
        # Candidate.objects.all().delete()
        Election.fetch_all_from_api()
        candidate1 = Candidate.objects.get(resource_uri="/api/v2/candidate/1/")
        answer8 = Answer.objects.get(resource_uri="/api/v2/answer/8/")
    def test_templatetag_candidate_answer_value(self):
        question = Question.objects.get(resource_uri="/api/v2/question/2/")
        candidate = Candidate.objects.get(resource_uri="/api/v2/candidate/1/")
        answer = Answer.objects.get(resource_uri="/api/v2/answer/8/")
 
    def test_template_tag_when_no_answer_is_selected(self):
        candidate = Candidate.objects.get(resource_uri="/api/v2/candidate/1/")
        question = Question.objects.get(resource_uri="/api/v2/question/3/")
        #No one has answered the question 3
        candidate.answers.all().delete()

src/v/o/votainteligente-portal-electoral-HEAD/elections/tests/photo_loader_tests.py   votainteligente-portal-electoral(Download)
    def test_it_loads_the_photo_for_an_existing_candidate(self):
        call_command('photo_loader', 'elections/tests/fixtures/candidate_photo_url.csv', verbosity=0)
 
        jano = Candidate.objects.get(name=u"Alejandro Guillier")
        otro = Candidate.objects.get(name=u"Manuel Rojas")
    def test_if_the_candidate_does_not_exist_it_does_it_for_the_rest(self):
        call_command('photo_loader', 'elections/tests/fixtures/candidate_photo_url.csv', verbosity=0)
 
        jano = Candidate.objects.get(name=u"Alejandro Guillier")
        otro = Candidate.objects.get(name=u"Manuel Rojas")
    def test_it_prepends_url_when_provided(self):
        call_command('photo_loader', 'elections/tests/fixtures/candidate_photo.csv', 'some.site/static/', verbosity=0)
 
        jano = Candidate.objects.get(name=u"Alejandro Guillier")
        otro = Candidate.objects.get(name=u"Manuel Rojas")

src/v/o/votainteligente-portal-electoral-HEAD/elections/tests/candideitorg_popit_tests.py   votainteligente-portal-electoral(Download)
    def setUp(self):
        super(CandideitorCandideitPopitPerson, self).setUp()
        self.pedro = Person.objects.get(id=1)
        self.marcel = Person.objects.get(id=2)
        self.candidato1 = CanCandidate.objects.get(id=1)
        self.candidato2 = CanCandidate.objects.get(id=2)