2019-10-14 21:35:54 +02:00
|
|
|
import pytest
|
2019-10-14 21:55:00 +02:00
|
|
|
from mixer.backend.django import mixer
|
2019-10-21 06:57:44 +02:00
|
|
|
from django.utils import timezone
|
2019-10-14 21:35:54 +02:00
|
|
|
|
2019-10-21 06:57:44 +02:00
|
|
|
from collector.models import Temperature, Humidity
|
2019-10-14 21:35:54 +02:00
|
|
|
|
|
|
|
pytestmark=pytest.mark.django_db
|
|
|
|
|
|
|
|
|
2019-10-14 21:55:00 +02:00
|
|
|
def test_db_objects():
|
2019-10-21 06:57:44 +02:00
|
|
|
time = timezone.now()
|
2019-10-14 21:55:00 +02:00
|
|
|
temp = mixer.blend('collector.Temperature', time=time)
|
|
|
|
humidity = mixer.blend('collector.Humidity', time=time)
|
|
|
|
assert time and temp and humidity
|