Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7687212
activity_expiration_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
913 B
Referenced Files
None
Subscribers
None
activity_expiration_test.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.ActivityExpirationTest
do
use
Pleroma.DataCase
alias
Pleroma.ActivityExpiration
import
Pleroma.Factory
test
"finds activities due to be deleted only"
do
activity
=
insert
(
:note_activity
)
expiration_due
=
insert
(
:expiration_in_the_past
,
%{
activity_id
:
activity
.
id
})
activity2
=
insert
(
:note_activity
)
insert
(
:expiration_in_the_future
,
%{
activity_id
:
activity2
.
id
})
expirations
=
ActivityExpiration
.
due_expirations
()
assert
length
(
expirations
)
==
1
assert
hd
(
expirations
)
==
expiration_due
end
test
"denies expirations that don't live long enough"
do
activity
=
insert
(
:note_activity
)
now
=
NaiveDateTime
.
utc_now
()
assert
{
:error
,
_
}
=
ActivityExpiration
.
create
(
activity
,
now
)
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 3, 7:39 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
319845
Default Alt Text
activity_expiration_test.exs (913 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment