Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

api: rest: add filter created_at #1135

Merged
merged 1 commit into from
Apr 9, 2024
Merged

api: rest: add filter created_at #1135

merged 1 commit into from
Apr 9, 2024

Conversation

roxell
Copy link
Contributor

@roxell roxell commented Apr 5, 2024

Make it possible to filter test jobs on 'created_at' date.

@@ -909,6 +909,11 @@ def test_testjob(self):
data = self.hit('/api/testjobs/%d/' % self.testjob.id)
self.assertEqual('myenv', data['environment'])

def test_testjob_filter_by_created_at(self):
very_old_date = str(datetime.datetime.now() - datetime.timedelta(days=365))
data = self.hit('/api/testjobs/?created_at=%s', very_old_date)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data = self.hit('/api/testjobs/?created_at=%s' % very_old_date)

Please change the ',' for '%'

Make it possible to filter test jobs on 'created_at' date.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Copy link
Collaborator

@chaws chaws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chaws chaws merged commit 3018fe8 into Linaro:master Apr 9, 2024
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants