Hello,
Yes, my recommended solution only works with Netbeans6.7. (I never
seen something comparable with that level of integration and test
coverage information...) But with a little effort you can probably
adapt it to another environment...
I detailed my motivations and the patches on my mail of July 2.
Essentially it was:
1) A patch in the Netbeans test runner to invoke App Engine Patch with
that:
os.environ['RUNNING_CONTEXT'] = 'test'
os.environ['SERVER_NAME'] = 'testserver'
os.environ['SERVER_PORT'] = '80'
os.environ['SERVER_SOFTWARE'] = 'Devel'
os.environ['USER_EMAIL'] = '' # set to '' for not logged in user
from common.appenginepatch import aecmd
aecmd.PROJECT_DIR = os.getcwd() + "/togae" # This should be your
settings.py dir
aecmd.setup_env()
2) You should add this in your settings.py:
import os
if 'RUNNING_CONTEXT' in os.environ.keys():
DATABASE_ENGINE = 'appengine' # 'appengine' pour les tests
DATABASE_SUPPORTS_TRANSACTIONS = False
DJANGO_STYLE_MODEL_KIND = False
To make it quicker, if you hesitate to install the Netbeans IDE, I can
send you a picture of the (in colour :-) coverage information... But I
need your e-mail to do that...
Bye,
Michel
On Jul 9, 10:09 am, Andi Albrecht <[email protected]>
wrote:
> On Fri, Jul 3, 2009 at 3:45 PM, Michelschr<[email protected]> wrote:
>
> > Hi,
>
> >> thanks for the explanations on how you do the testing. I assume you've
> >> grabbed the Rietveld test cases you've mentioned from the testing
> >> branch?
>
> > I got 1 file: tests.py from this branch and the tests passed easily!
>
> > Nice to have, I removed the os.environ['... as you asked!
>
> > import codereview.models as models
> > import codereview.engine as engine
>
> > # Set some essential variables.
> > # TODO(guido): Shouldn't InstallAppengineHelperForDjango() do this?
> > #os.environ['SERVER_NAME'] = 'localhost'
> > #os.environ['SERVER_PORT'] = '80'
> > #os.environ['USER_EMAIL'] = ''
>
> > These basic tests cover 31% of 5751 lines. Particularly:
> > 9,9% of engine
> > 16% of intra_region_diff
> > 22% of views
> > (...)
>
> > For views, I can point quickly that these portions of code are not
> > tested:
> > def render(self, name, value, attrs=None):
> > def set_branch_choices(self, base=None):
> > def get_base(self):
> > def clean_base(self):
> > def clean(self):
> > def clean_nickname(self):
> > (...)
>
> > I suggest you make a quick try of Netbeans6.7 with my different
> > patches to see that in colour... :-)
>
> Sorry for the delayed reply, I'm not sure which patches you're talking
> about... Does this only work with Netbeans?
>
> Andi
>
>
>
> > Have a hot weekend!
>
> > Michel
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---