cleemesser avatar cleemesser committed 63623ec

more work on testproject for django 1.5

Comments (0)

Files changed (7)

tests/requirements.txt

-django
-django-debug-toolbar
+django==1.5.1
+pyopenssl  # required for testing ssl

tests/testdjangoproject/test_ssl

-#!/bin/sh
-python manage.py runwsgiserver ssl_certificate=`pwd`/testserver.crt ssl_private_key=`pwd`/testserver.key port=8443

tests/testdjangoproject/test_staticfiles

-#!/bin/sh
-export PYTHONPATH=".:$PYTHONPATH"
-python ./manage.py runwsgiserver --settings=settings_statics

tests/testdjangoproject/testdjango/test_staticfiles

+#!/bin/sh
+export PYTHONPATH=".:$PYTHONPATH"
+python ./manage.py runwsgiserver --settings=settings_statics

tests/testdjangoproject/testdjango/testdjango/views.py

     #c.update(csrf(request))
     return HttpResponse(template.render(c))
 
-
-
     
 def testajax(request):
+    # figuring out how to get csrftoken from this side of django
     # print "called testajax: ", request
     method = request.META['REQUEST_METHOD']
     c = RequestContext(request)
-    print "********************"
-    print "RequestContext info:"
+    # print "********************"
+    # print "RequestContext info:"
     # ['autoescape', 'dicts', 'current_app', 'render_context', 'use_l10n', 'use_tz']
     # print c.META # c.dicts[1]['csrf_token'] # __dict__.keys()
-    try:
-        print "request.META['HTTP_X_CSRFTOKEN']:", request.META['HTTP_X_CSRFTOKEN']
-    except:
-        pass
+    #try:
+    #    print "request.META['HTTP_X_CSRFTOKEN']:", request.META['HTTP_X_CSRFTOKEN']
+    #except:
+    #    pass
     # .set_cookie('X-CSRFToken', csrftoken)
     if  method == 'GET':
         if request.is_ajax():

tests/testdjangoproject/testserver.crt

------BEGIN CERTIFICATE-----
-MIIBpjCCAVACCQC72spIX8JK0DANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJV
-UzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxEzARBgNV
-BAoTCkR1bW15IENlcnQxDjAMBgNVBAMTBWNocmlzMB4XDTA5MDEwNDE5NTIxOVoX
-DTE0MDYyNzE5NTIxOVowWjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3Ju
-aWExETAPBgNVBAcTCFNhbiBKb3NlMRMwEQYDVQQKEwpEdW1teSBDZXJ0MQ4wDAYD
-VQQDEwVjaHJpczBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCrZ5O5lwaAZWaqM4mU
-8wRGKfBW/TBbKsKMxyluU/mSXi5b04UAXrkkG5D+jgS+TadsS9GPGElgEbQYZ2wk
-v74LAgMBAAEwDQYJKoZIhvcNAQEFBQADQQB2NJLi/oZTh/H56fYyxy9pXukCImR3
-KnM/eFfkY/dQmdb00WbXQAaWd3XXRQikj+Th8rS46KPTvKVaD5D68EJN
------END CERTIFICATE-----

tests/testdjangoproject/testserver.key

------BEGIN RSA PRIVATE KEY-----
-MIIBOwIBAAJBAKtnk7mXBoBlZqoziZTzBEYp8Fb9MFsqwozHKW5T+ZJeLlvThQBe
-uSQbkP6OBL5Np2xL0Y8YSWARtBhnbCS/vgsCAwEAAQJBAKBSEh+OPluL/NoHuJEk
-OQQzqASFb1xmg3BPvNXgH9ihTRe9w45+X0y8TzJzzKKOuJDTrIhWUnaCgcbBnP+F
-QjECIQDSIQE5TJbKbuuPcodJkWgkK4K0G1z8F+jHqvWDoePXMwIhANDSeWlMXFDF
-FX7YBpWprWAB5Po85eio9QYqJsH0mR3JAiBuOMPUk5kxXJeRqkjOzUgsWOp5oTTY
-Q45mVgXs41mJQwIgPXrqMf1AZKtRw9GYRrH5EH4eSypoyhIMaa85T/tSpTkCIQDD
-me0zT1zX2L48S9hKPu5+80Tr09srvKITAu00GdLdXQ==
------END RSA PRIVATE KEY-----
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.