Exemple #1
0
def build_search(request, template_name="searchv2/build_results.html"):

    if not request.user.is_superuser:
        return HttpResponseForbidden()

    results = []
    if request.method == "POST":
        results = build_1(False)

    return render(request, template_name, {"results": results})
Exemple #2
0
def build_search(request, template_name="searchv2/build_results.html"):

    if not request.user.is_superuser:
        return HttpResponseForbidden()

    results = []
    if request.method == 'POST':
        results = build_1(False)

    return render(request, template_name, {'results': results})
Exemple #3
0
def build_search(request, template_name="searchv2/build_results.html"):
    
    if not request.user.is_superuser:
        return HttpResponseForbidden()
        
    results = []
    if request.method == 'POST':
        results = build_1(False)

    return render_to_response(template_name,
                {'results':results},
                context_instance=RequestContext(request))
Exemple #4
0
 def test_search_function(self):
     build_1(False)
     results = search_function('ser')
     self.assertEquals(results[0].title, 'Serious Testing')
 def test_build_1_count(self):
     self.assertEqual(SearchV2.objects.count(), 0)
     build_1()
     self.assertEqual(SearchV2.objects.count(), 6)
 def test_build_1_count(self):
     self.assertEquals(SearchV2.objects.count(), 0)
     build_1(False)
     self.assertEquals(SearchV2.objects.count(), 6)
 def setUp(self):
     initial_data.load()
     for user in User.objects.all():
         profile = Profile.objects.create(user=user)
         profile.save()
     build_1()
 def test_search_function(self):
     build_1(False)
     results = search_function('ser')
     self.assertEqual(results[0].title, 'Serious Testing')
    def handle(self, *args, **options):

        print >> stdout, "Commencing search result building now %s " % strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
        build_1()
        print >> stdout, "Finished at %s" % strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
    def handle(self, *args, **options):

        print("Commencing search result building now %s " % strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()), file=stdout)
        build_1()
        print("Finished at %s" % strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()), file=stdout)
        healthcheck(settings.SEARCHV2_HEALTHCHECK_URL)
 def setUp(self):
     initial_data.load()
     for user in User.objects.all():
         profile = Profile.objects.create(user=user)
         profile.save()
     build_1()