Skip to content

Commit

Permalink
Don't send 'created' in download requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBlissett committed Jan 24, 2023
1 parent b8173d1 commit 44c726b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions pygbif/occurrences/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ def __init__(self, creator, email, polygon=None):
self.payload = {
"creator": creator,
"notification_address": [email],
"send_notification": "true",
"created": datetime.date.today().year,
"sendNotification": True,
"predicate": {"type": self._main_pred_type, "predicates": self.predicates},
}
self.request_id = None
Expand Down
8 changes: 3 additions & 5 deletions test/test-occurrences-download_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DummyClass(object):


def dummypost(*args, **kwargs):
"""function ot mock the usage of the requests.post functionality"""
"""function to mock the usage of the requests.post functionality"""
return DummyClass()


Expand All @@ -27,11 +27,10 @@ def test_gbif_creation(self):
self.assertDictEqual(
req.payload,
{
"created": int(time.strftime("%Y")),
"creator": "name",
"notification_address": ["email"],
"predicate": {"predicates": [], "type": "and"},
"send_notification": "true",
"sendNotification": True,
},
)
self.assertIsNone(req.request_id)
Expand All @@ -44,11 +43,10 @@ def test_alternative_main_type(self):
self.assertDictEqual(
req.payload,
{
"created": int(time.strftime("%Y")),
"creator": "name",
"notification_address": ["email"],
"predicate": {"predicates": [], "type": "or"},
"send_notification": "true",
"sendNotification": True,
},
)

Expand Down

0 comments on commit 44c726b

Please sign in to comment.