fix the db test
This commit is contained in:
parent
6e6e846686
commit
01f02ca4d3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue