Feature request: A Database for testing that just navigates through Model attributes
A "fake"/in-memory system is not going to happen. One would need to implement relational algebra and all the intricacies of a sql storage engine.

There are suggestions in the docs for testing: http://docs.peewee-orm.com/en/latest/peewee/database.html#testing-peewee-applications

Those are the recommended ways. Using a test sqlite database with fixture data being probably one of the more common.
I've had a great experience with Peewee so far. Thanks for your work maintaining it!

I apologize if this is better suited for StackOverflow -- it seems like more of a feature request, but perhaps it's out of scope or there's an extant solution.

My main issue with using Peewee is that it's difficult to abstract away the database for testing.
I've tried a few solutions:
1. Have test fixtures instantiate transactions and roll back per test.
2. Have an abstract `QuerySet` containing the needed `SELECT` queries per test, and use dependency injection to swap the database-backed implementations with mocked ones.
3. Write an abstraction of peewee's `Expression`, `ColumnBase`, `Query`, etc., and use dependency injection to swap the databased-backed implementations with ones that navigate through `Model` subclasses by accessing attributes.

- (1.) is not a principled solution because it requires a database dependency, and the performance is poor.
- (2.) is effective, but requires knowing which queries are needed per test. This exposes part of the implementation (which specific queries are needed), and requires injecting a new query whenever a new query is needed.
- (3.) Is what I'm wondering about. See the example below.

```python
class Product(peewee.Model):
    seller = peewee.ForeignKeyField(column_name="seller", field="id", model=Sellers)
    class Meta: ...

class Seller(peewee.Model):
    name = peewee.CharField()
    class Meta: ...
```

In the above, a mocked database could just traverse directly a `Product` to the `Seller` via an attribute `seller` (or `_seller`).
Then using the new subclass of `Database`, this would immediately work:

```python
product = Product(seller=Seller(name="hi"))
product.seller.name = "test"
```

I recognize that this is a heavy feature request.
I began to write some code, but I'm still not familiar enough with peewee's inner-workings.
Unfortunately, I've so far found it quite difficult to write tests (in a moderately large codebase).
