Thursday, August 27, 2009

app-engine-patch Database problems

I've been using app-engine-patch to get some Django stuff running on Google AppEngine.

Several times my admin password has been reset or invalidated. On a couple of occasions I recreated the admin user from the link on the default page. After styling the site this wasn't possible.

I added the "create_admin_user" entry from the generated myapp/urls.py to the root level urls.py and manually entered the url. That worked.



Unexpected Groovy return value

I like Groovy's multiline Strings. I use them all the time in my test cases. Usually I have a utility class that returns whatever content I need.

Yesterday I decided to do the whole test in Groovy. Inside my TestNG test case I had a method that returned some xml :

    String createInputFile(){
return
'''
<xml><one>Hello</one><two>World!</two></xml>
'''
}


The output was null. Kind of silly of me. Adding a semicolon after the String didn't produce an output. Putting the opening quote on the same line as the return statement did.

I still don't miss semicolons though.