Fixed fact cache test difference between sqlite3 and postgres

I guess the sqlite adaptation of the JSONField was resulting in a json
encoded blob, where as the postgres version returned something that got
parsed out normally with the rest of the query result?
This commit is contained in:
Akita Noek
2016-04-19 14:27:59 -04:00
parent 6349cc0f85
commit c0e056d6d0
2 changed files with 5 additions and 7 deletions

View File

@@ -4,7 +4,6 @@
# Python
import pytest
from datetime import datetime
import json
# Django
from django.utils import timezone
@@ -80,12 +79,12 @@ def test_process_facts_message_ansible_overwrite(fact_scans, fact_msg_ansible):
fact_obj = Fact.objects.get(id=fact_returned.id)
assert key in fact_obj.facts
assert json.loads(fact_obj.facts) == fact_msg_ansible['facts']
assert value == json.loads(fact_obj.facts)[key]
assert fact_obj.facts == fact_msg_ansible['facts']
assert value == fact_obj.facts[key]
# Ensure that the message flows from the socket through to process_fact_message()
@pytest.mark.django_db
def test_run_receiver(mocker, fact_msg_ansible):
def test_run_receiver(mocker, fact_msg_ansible):
mocker.patch("awx.main.socket.Socket.listen", return_value=[fact_msg_ansible])
receiver = FactCacheReceiver()