Testing#

Tests are partitioned by their external dependencies and CI runs each partition as a separate job. For day-to-day commands see Testing.

Partitions#

  • Default – pure logic, ORM, view and template tests. Must always pass; failures block merge.

  • Network – tests whose code paths reach the public internet (Yahoo Finance via feedparser / yfinance / rug, CoinCodex and CoinGecko via karpet, article metadata via MetadataParser). Decorated with @tag("network").

Network tests are fragile in CI: the runner’s data-center egress IP is regularly throttled by finance and news sites. The downloader stack has per-request timeouts, but the upstream answer is not under our control, so these tests are allowed to fail in CI.

Filtering#

$ ./manage.py test --exclude-tag=network    # CI's ``tests`` job
$ ./manage.py test --tag=network            # CI's ``tests:network``

When to tag#

Apply @tag("network") (from django.test) when a test exercises any code path that makes a real HTTP / socket call via feedparser, requests, metadata_parser, yfinance, rug, karpet, or aiohttp. Tests that mock the dependency with @patch do not need the tag – the mock makes them deterministic.

See CI for the corresponding CI jobs.