File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,13 @@ def get_flushes(credentials: HTTPBasicCredentials = Depends(security)):
169
169
check_creds (credentials )
170
170
flushes = client .flush .flushes
171
171
try :
172
- entries = [x for x in flushes .find (filter = {"user_id" : credentials .username })]
172
+ entries = [
173
+ x
174
+ for x in flushes .find (
175
+ filter = {"user_id" : credentials .username },
176
+ sort = [("time_start" , pymongo .DESCENDING )],
177
+ )
178
+ ]
173
179
for entry in entries :
174
180
del entry ["_id" ]
175
181
del entry ["user_id" ]
Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ def test_getting_flushes():
62
62
"/flushes" , auth = BasicAuth (username = username , password = password )
63
63
)
64
64
assert response .status_code == status .HTTP_200_OK
65
- assert response .json () == flushes
65
+ rev = flushes
66
+ rev .reverse ()
67
+ print (rev )
68
+ print (response .json ())
69
+ assert response .json () == rev
66
70
67
71
68
72
def test_getting_flushes_noflushes ():
You can’t perform that action at this time.
0 commit comments