mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 21:37:42 -02:30
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user