mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 05:01:09 -02:30
use new timestamp logic in tests
This commit is contained in:
@@ -7,6 +7,7 @@ from datetime import datetime
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.management.commands.run_fact_cache_receiver import FactCacheReceiver
|
from awx.main.management.commands.run_fact_cache_receiver import FactCacheReceiver
|
||||||
@@ -18,7 +19,7 @@ def check_process_fact_message_module(fact_returned, data, module_name):
|
|||||||
date_key = data['date_key']
|
date_key = data['date_key']
|
||||||
|
|
||||||
# Ensure 1, and only 1, fact created
|
# Ensure 1, and only 1, fact created
|
||||||
timestamp = datetime.fromtimestamp(date_key, None)
|
timestamp = datetime.fromtimestamp(date_key, timezone.utc)
|
||||||
assert 1 == Fact.objects.all().count()
|
assert 1 == Fact.objects.all().count()
|
||||||
|
|
||||||
host_obj = Host.objects.get(name=data['host'], inventory__id=data['inventory_id'])
|
host_obj = Host.objects.get(name=data['host'], inventory__id=data['inventory_id'])
|
||||||
|
|||||||
Reference in New Issue
Block a user