Beispiel #1
0
 def testUploadComplete(self):
     from django.http import QueryDict, HttpRequest
     from tardis.tardis_portal.views import upload_complete
     data = [('filesUploaded', '1'), ('speed', 'really fast!'),
             ('allBytesLoaded', '2'), ('errorCount', '0')]
     post = QueryDict('&'.join(['%s=%s' % (k, v) for (k, v) in data]))
     request = HttpRequest()
     request.POST = post
     response = upload_complete(request)
     self.assertTrue('<p>Number: 1</p>' in response.content)
     self.assertTrue('<p>Errors: 0</p>' in response.content)
     self.assertTrue('<p>Bytes: 2</p>' in response.content)
     self.assertTrue('<p>Speed: really fast!</p>' in response.content)
Beispiel #2
0
    def testUploadComplete(self):
        from django.http import QueryDict, HttpRequest
        from tardis.tardis_portal.views import upload_complete

        data = [("filesUploaded", "1"), ("speed", "really fast!"), ("allBytesLoaded", "2"), ("errorCount", "0")]
        post = QueryDict("&".join(["%s=%s" % (k, v) for (k, v) in data]))
        request = HttpRequest()
        request.POST = post
        response = upload_complete(request)
        self.assertTrue("<p>Number: 1</p>" in response.content)
        self.assertTrue("<p>Errors: 0</p>" in response.content)
        self.assertTrue("<p>Bytes: 2</p>" in response.content)
        self.assertTrue("<p>Speed: really fast!</p>" in response.content)
 def testUploadComplete(self):
     from django.http import QueryDict, HttpRequest
     from tardis.tardis_portal.views import upload_complete
     data = [('filesUploaded', '1'), ('speed', 'really fast!'),
             ('allBytesLoaded', '2'), ('errorCount', '0')]
     post = QueryDict('&'.join(['%s=%s' % (k, v) for (k, v) in data]))
     request = HttpRequest()
     request.POST = post
     response = upload_complete(request)
     self.assertTrue('<p>Number: 1</p>' in response.content)
     self.assertTrue('<p>Errors: 0</p>' in response.content)
     self.assertTrue('<p>Bytes: 2</p>' in response.content)
     self.assertTrue('<p>Speed: really fast!</p>' in response.content)