Skip to content

Commit

Permalink
Removed hardcoded year 2018 from tests (#539) (#541)
Browse files Browse the repository at this point in the history
* Removed hardcoded year 2018 from tests (#539)
  • Loading branch information
PUREMATH authored and n2ygk committed Jan 3, 2019
1 parent 6518cdb commit 11e0edd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Tim Selman <timcbaoth@gmail.com>
Yaniv Peer <yanivpeer@gmail.com>
Mohammed Ali Zubair <mazg1493@gmail.com>
Jason Housley <housleyjk@gmail.com>
Beni Keller <beni@matraxi.ch>
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ any parts of the framework not mentioned in the documentation should generally b
* Do not render `write_only` relations
* Do not skip empty one-to-one relationships
* Allow `HyperlinkRelatedField` to be used with [related urls](https://django-rest-framework-json-api.readthedocs.io/en/stable/usage.html?highlight=related%20links#related-urls)

* Fixed hardcoded year 2018 in tests ([#539](https://github.com/django-json-api/django-rest-framework-json-api/issues/539))

## [2.6.0] - 2018-09-20

Expand Down
3 changes: 2 additions & 1 deletion example/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json

from datetime import datetime
from django.test import RequestFactory
from django.utils import timezone
from rest_framework.exceptions import NotFound
Expand Down Expand Up @@ -466,7 +467,7 @@ def test_get_object_gives_correct_blog(self):
'attributes': {'name': self.blog.name},
'id': '{}'.format(self.blog.id),
'links': {'self': 'http://testserver/blogs/{}'.format(self.blog.id)},
'meta': {'copyright': 2018},
'meta': {'copyright': datetime.now().year},
'relationships': {'tags': {'data': []}},
'type': 'blogs'
},
Expand Down
9 changes: 5 additions & 4 deletions example/tests/unit/test_default_drf_serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json

import pytest
from datetime import datetime
from django.urls import reverse
from rest_framework import viewsets
from rest_framework.serializers import ModelSerializer, SerializerMethodField
Expand Down Expand Up @@ -108,7 +109,7 @@ def test_blog_create(client):
'attributes': {'name': blog.name},
'id': '{}'.format(blog.id),
'links': {'self': 'http://testserver/blogs/{}'.format(blog.id)},
'meta': {'copyright': 2018},
'meta': {'copyright': datetime.now().year},
'relationships': {'tags': {'data': []}},
'type': 'blogs'
},
Expand All @@ -129,7 +130,7 @@ def test_get_object_gives_correct_blog(client, blog, entry):
'attributes': {'name': blog.name},
'id': '{}'.format(blog.id),
'links': {'self': 'http://testserver/blogs/{}'.format(blog.id)},
'meta': {'copyright': 2018},
'meta': {'copyright': datetime.now().year},
'relationships': {'tags': {'data': []}},
'type': 'blogs'
},
Expand All @@ -151,7 +152,7 @@ def test_get_object_patches_correct_blog(client, blog, entry):
'attributes': {'name': new_name},
'id': '{}'.format(blog.id),
'links': {'self': 'http://testserver/blogs/{}'.format(blog.id)},
'meta': {'copyright': 2018},
'meta': {'copyright': datetime.now().year},
'relationships': {'tags': {'data': []}},
'type': 'blogs'
},
Expand All @@ -167,7 +168,7 @@ def test_get_object_patches_correct_blog(client, blog, entry):
'attributes': {'name': new_name},
'id': '{}'.format(blog.id),
'links': {'self': 'http://testserver/blogs/{}'.format(blog.id)},
'meta': {'copyright': 2018},
'meta': {'copyright': datetime.now().year},
'relationships': {'tags': {'data': []}},
'type': 'blogs'
},
Expand Down

0 comments on commit 11e0edd

Please sign in to comment.