environment_sensors/sensors/collector/tests/test_db.py

16 lines
417 B
Python
Raw Normal View History

2019-10-14 21:35:54 +02:00
import datetime
import pytest
from django.test import TestCase
2019-10-14 21:55:00 +02:00
from mixer.backend.django import mixer
2019-10-14 21:35:54 +02:00
2019-10-14 21:55:00 +02:00
from collector.models import Time, 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():
time = mixer.blend('collector.Time')
temp = mixer.blend('collector.Temperature', time=time)
humidity = mixer.blend('collector.Humidity', time=time)
assert time and temp and humidity