>From console: >>> db._folder 'applications/myapp/databases' >>> request.folder 'applications/myapp'
Print statements from search_test.py, the unit test: applications/myapp/databases applications/myapp On May 4, 10:27 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > and what is in db._folder? > > On May 4, 9:27 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > Perhpas something is causing the test script to pick up the wrong > > database. What is in request.folder from console? > > > On May 4, 8:44 pm, Matthew <matthew.g.nor...@gmail.com> wrote: > > > > Thanks for the quick reply! > > > > They are in the db. That's why running the code from the console works > > > and why it's puzzling that the script doesn't since the same > > > environment is set up. > > > > On May 4, 9:28 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > I do not think that line is the problem. Are the records in the db > > > > already or are they stored by the unit_test? > > > > > On May 4, 8:12 pm, Matthew <matthew.g.nor...@gmail.com> wrote: > > > > > > I'm attempting to unit test a method by > > > > > followinghttp://web2py.com/AlterEgo/default/show/260. If I run the > > > > > query inside > > > > > the console, it works fine. If I run it in my unit tests, it returns > > > > > no results (NOTE that there are no errors in the unit test). > > > > > > Here is the query: > > > > > > rows = db(db.flavor.id>0).select().\ > > > > > find(lambda row:row.name.startswith(term)) > > > > > > WORKS (17 results): python web2py.py -S myapp -M > > > > > DOES NOT WORK (0 results): python web2py.py -S myapp -M -R > > > > > applications/myapp/tests/test_search.py > > > > > > Thanks, > > > > > Matthew