Skip to content

Commit

Permalink
Revert "Amend tests for changes is timestamp formatting"
Browse files Browse the repository at this point in the history
This reverts commit 49c2523.
  • Loading branch information
suutari-ai committed Dec 12, 2017
1 parent 49c2523 commit 5760537
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions parkings/tests/api/enforcement/test_valid_parking.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from django.core.urlresolvers import reverse
from django.utils.timezone import localtime, utc
from django.utils.timezone import utc
from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN

from ..utils import (
Expand Down Expand Up @@ -97,17 +97,11 @@ def check_parking_data_matches_parking_object(parking_data, parking_obj):


def iso8601(dt):
return add_colon_to_tz(localtime(dt).strftime('%Y-%m-%dT%H:%M:%S%z'))
return dt.strftime('%Y-%m-%dT%H:%M:%SZ')


def iso8601_us(dt):
return add_colon_to_tz(localtime(dt).strftime('%Y-%m-%dT%H:%M:%S.%f%z'))


def add_colon_to_tz(timestamp_string):
assert isinstance(timestamp_string, str)
assert timestamp_string[-4:].isdigit(), "Last 4 chars should be digits"
return timestamp_string[:-2] + ':' + timestamp_string[-2:]
return dt.strftime('%Y-%m-%dT%H:%M:%S.%fZ')


def test_registration_number_filter(operator, staff_api_client, parking_factory):
Expand Down

0 comments on commit 5760537

Please sign in to comment.