Hi Arnon. The idea to have an in-memory db is to test a web app the same way Django does.
So, it's up to the developer to choose what must be coded in which function (or method, or routine). If he/she wants to mix all sort of rules and accesses, it's possible. If not, it's too. In this case, due to simple approach Web2py has relating to data access, I think it's not necessary to worry about this kind of abstraction. In my personal experience, it has more cons than pros, but I don't own the trueth. ;-) I agree it is an architecture smell. But, again, a fully decoupled system is not a simple thing to achieve. Personally, I'd rather have some pieces coupled to a data access layer with tests than a complicated way to decouple things and be purist at extreme. I didn't finish my studies in this area. I'm making some experiments with all these things. On Thu, May 16, 2013 at 12:43 PM, Arnon Marcus <[email protected]> wrote: > I'm not sure how you are goint to implement an in-memory relational-database > that can be used woth the same db-object-using code - that sounds > ineresting... > > But this has a smell of having your unit-test testing the framework, more > than your code, the same problem that exists in django. > > Ideally this should be avoided... > And it can - with mock-objects that substute the db object, emulating it's > api-calls that your code is using. It's eazier than you might think, using > the 'mock' library - check out the link I posted. > It would also be even faster than a memory-database, and much simpler. > The only downside is that anytime your query-code changes, you would have to > update your tests... > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

