Skip to content

Commit

Permalink
migrate old tests to pytest-apiver
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Jun 21, 2024
1 parent ff50428 commit 335249e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
13 changes: 13 additions & 0 deletions tests/unit/api/test_metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest


@pytest.mark.django_db
def test_users_n_active_users(apiver_module, user_model):
assert apiver_module.users() == 0
assert apiver_module.active_users() == 0
user_model.objects.create(username="test")
assert apiver_module.users() == 1
assert apiver_module.active_users() == 1
user_model.objects.create(username="test2", is_active=False)
assert apiver_module.users() == 2
assert apiver_module.active_users() == 1
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import pytest

from django_business_metrics.v0 import BusinessMetricsManager, users


@pytest.fixture
def metrics_manager():
return BusinessMetricsManager()
def metrics_manager(apiver_module):
return apiver_module.BusinessMetricsManager()


@pytest.fixture
def user_metric(metrics_manager):
return metrics_manager.add(users)
def user_metric(apiver_module, metrics_manager):
return metrics_manager.add(apiver_module.users)


@pytest.mark.django_db
Expand Down
Empty file removed tests/v0/__init__.py
Empty file.
15 changes: 0 additions & 15 deletions tests/v0/test_metrics.py

This file was deleted.

0 comments on commit 335249e

Please sign in to comment.