mirror of
https://github.com/boostorg/website-v2.git
synced 2026-02-27 17:42:08 +00:00
23 lines
610 B
Python
23 lines
610 B
Python
import pytest
|
|
|
|
from model_bakery import baker
|
|
|
|
from versions.models import Version, VersionFile
|
|
|
|
|
|
def test_active_manager(version):
|
|
v2 = baker.make("versions.Version", name="Sample 1", active=False)
|
|
v3 = baker.make("versions.Version", name="Sample 2", active=False)
|
|
|
|
assert Version.objects.active().count() == 1
|
|
|
|
|
|
def test_most_recent_manager(version, inactive_version, old_version):
|
|
assert Version.objects.most_recent() == version
|
|
|
|
|
|
def test_active_file_manager(version, inactive_version):
|
|
|
|
assert Version.objects.active().count() == 1
|
|
assert VersionFile.objects.active().count() == 1
|