No description
Find a file
2022-09-02 10:59:14 +02:00
task_manager Add some error checking 2022-09-02 10:59:14 +02:00
tests Add some error checking 2022-09-02 10:59:14 +02:00
webapp Add some error checking 2022-09-02 10:59:14 +02:00
.copier-answers.yml Initial commit 2022-08-30 10:15:15 +02:00
.flake8 Initial commit 2022-08-30 10:15:15 +02:00
.gitignore Fix integration of Repository in Django 2022-08-30 16:39:58 +02:00
manage.py Add a 'webapp' django project 2022-08-30 11:54:35 +02:00
mypy.ini More mypy config 2022-09-02 10:58:40 +02:00
poetry.lock Add an index view and some tests 2022-08-30 12:02:25 +02:00
pyproject.toml Add an index view and some tests 2022-08-30 12:02:25 +02:00
pytest.ini Add an index view and some tests 2022-08-30 12:02:25 +02:00
README.md Update README.md 2022-08-30 16:59:23 +02:00
tasks.py Add an index view and some tests 2022-08-30 12:02:25 +02:00

Hexa in Django

An example of using hexagonal architecture with Django

We "prove" the architecture works by:

  • Having both a CLI and a Web API
  • Having both a DB backed by a JSON file and the Django ORM

The Good

We can write end-to-end tests using the Django test client, without hitting the django DB, which could speed things up.

We never have to call refresh_from_db() in the tests (which often happens when writing tests using the django ORM directly)

In tests/test_repository.py we check that both implementations of the Repository work the same way.

The Bad

There's a quite a lot of duplication between the tests.

The Ugly

We mutate webapp.env.repository (a global!) during the tests, when the test_repository fixture is used