Hello, Let's make a bit of walk together, here are some ideas:
1) I am testing Netbeans 6.7 python early access 2, and it looks pretty fine for testing purpose (nice presentation of test results, easy to go to the code, able to run test in the Netbeans project, but above what I will transmit to GAE... + I still don't say that everything is perfect, for example, it mix a bit the counting of tests...) http://download.netbeans.org/netbeans/6.7/python/ea2/ 2) I founded yesterday these interesting links in the GAE discussion, but I don't reden them yet: http://domderrien.blogspot.com/2009/01/automatic-testing-of-gae-applications.html http://blog.appenginefan.com/2008/06/unit-tests-for-google-app-engine-apps.html 3) I don't have investigated your problem in detail yet but: a) I suppose you have read the django doc about this topic, normally, they have material about that... b) I am begining to investigate a bit more... It's not easy to make that import of the django Client, I don't know in which context you try this import... I will try to solve my one... With Netbeans 6.7, when I try this import, it simply don't take the test any more in consideration, silently... Thus, I tried it in a python console: NbPython console Python 2.5.4 (r254:67916, Apr 4 2009, 17:55:16) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from django.test.client import Client Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/lib/python2.5/site-packages/django/test/__init__.py", line 6, in <module> from django.test.testcases import TestCase File "/usr/lib/python2.5/site-packages/django/test/testcases.py", line 10, in <module> from django.db import transaction File "/usr/lib/python2.5/site-packages/django/db/__init__.py", line 9, in <module> if not settings.DATABASE_ENGINE: File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 28, in __getattr__ self._import_settings() File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 57, in _import_settings raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. >>> Like that I see better some problems, but I don't know if this is also relevant for you? If you run in a django environment like App Engine Patch, you don't have this kind of problems because these settings are done fou you... Hope it helps, Michel On Jun 30, 1:33 am, Akume <[email protected]> wrote: > ok, > what about this scenario. some of my pages require a login prior to > seeing the content and i can't see to get this to work using the > django > client. any suggestions? this is what my test looks like so far. > > import unittest > from django.test.client import Client > > class Test(unittest.TestCase): > def setUp(self): > self.client = Client() > > def testStart(self): > response = self.client.get('/app/layout') > self.failUnlessEqual(response.status_code, 301) > > #attempting to log in here. > response = self.client.get('/_ah/login?continue=http%3A//localhost > %3A8081/app/layout') > self.failUnlessEqual(response.status_code, 302) > > # another attempt at logging in. > #response = self.client.get('/_ah/login?email=Aliquam.nec > %40Vestibulumante.edu&action=Login&continue=http%3A%2F%2Flocalhost > %3A8081%2Fapp%2Flayout') > response = self.client.login(path='/app/layout', > username='Aliquam.nec%40Vestibulumante.edu', password='') > self.failUnlessEqual(response, True) > > response = self.client.get('/app/layout') > self.failUnlessEqual(response.status_code, 200) > > On Jun 26, 12:15 pm, Michelschr <[email protected]> wrote: > > > I had GaeUnit working on Rietveld (à la Guido...), the test: > > > import unittest > > from django.test.client import Client > > > class Test(unittest.TestCase): > > > def testDjango(self): > > c = Client() > > response = c.get('/code') > > self.failUnlessEqual(response.status_code, 200) > > self.failIf(not ('SERVER' in response.content)) > > > passed, not possible (for me) to 'from django.test import TestCase' > > only from unittest. > > > But it is not out of the box! You should search a lot by yourself... > > > I will continue to investigate... > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
