fix the db test

This commit is contained in:
Andreas Zweili 2019-10-14 21:55:00 +02:00
parent 6e6e846686
commit 01f02ca4d3
1 changed files with 7 additions and 5 deletions

View File

@ -1,13 +1,15 @@
import datetime import datetime
import pytest import pytest
from django.test import TestCase from django.test import TestCase
from mixer.backend.django import mixer
from collector.models import Time, Temperatur, Humidity from collector.models import Time, Temperature, Humidity
pytestmark=pytest.mark.django_db pytestmark=pytest.mark.django_db
def test_create_temperatur(): def test_db_objects():
time = Time.objects.create(value=datetime.datetime.now()) time = mixer.blend('collector.Time')
temp = Temperatur.objects.create(value=20.0, time=time) temp = mixer.blend('collector.Temperature', time=time)
assert False humidity = mixer.blend('collector.Humidity', time=time)
assert time and temp and humidity