Marnanel Thurman
c8a5b5308b
TrilbyTestCase descends from KepiTestCase
2023-09-23 14:32:59 +01:00
Marnanel Thurman
94309cc77d
KepiTestCase
...
The only difference from django.test.TestCase is that KepiTestCase
redirects logging to stdout in setUp, and undoes it again in
tearDown. This is because Django's "./manage.py test" suppresses
stderr, so you can't read the debug logs otherwise.
Put into use in a couple of files where it was needed immediately.
Will add more later.
2023-09-22 16:36:51 +01:00
Marnanel Thurman
b00f844d84
Follow -> FollowUser; Unfollow -> UnfollowUser
...
Since k.t.models also has a Follow class, it was getting confusing.
urls also doesn't "import *" the views classes any more, for clarity.
There were some classes duplicated between persons.py and statuses.py;
they have been confined to persons.py.
__init__.py has content.
2023-09-22 16:36:51 +01:00
Marnanel Thurman
8a0deb6c93
AppConfigs set default_auto_field
...
Django used to default this, but it generates a warning now.
2023-09-22 16:36:47 +01:00
Marnanel Thurman
4d63fd669d
Remove "providing_args" from signals
...
This will probably break them, but we don't need them at present.
2023-09-22 16:36:22 +01:00
Marnanel Thurman
7233d203bd
trilby's AppConfig.name set to the fully-qualified path
2021-05-31 16:13:34 +01:00
Marnanel Thurman
71c6d26ad8
Param values are strings, not bools.
...
All tests now pass!
2021-02-18 19:24:48 +00:00
Marnanel Thurman
574176b42b
"only_media" stub
2021-02-18 18:47:45 +00:00
Marnanel Thurman
a5848e45e2
test_as_follower moved to home timeline test, rather than public timeline test.
...
Test of "since" param, which doesn't exist, replaced with the correct "since_id".
Removed a lot of debug code that shouldn't have been checked in.
Fixed some comments.
2021-02-18 18:37:43 +00:00
Marnanel Thurman
46b3dcfbf7
__ge and __le filters replaced with the correct __gte and __lte
2021-02-18 18:37:11 +00:00
Marnanel Thurman
31dede8c2c
Better logging for inbox calculation
2021-02-18 18:36:37 +00:00
Marnanel Thurman
3ad00cfae0
tests for remote and local params on timelines fixed to produce actual remote statuses!
2021-02-17 22:44:21 +00:00
Marnanel Thurman
37d53b2e4e
Status.content and Status.spoiler_text are now Status.content_source and Status.spoiler_source.
...
HTML renderings of each one are cached. You can access them at Status.content_as_html
and Status.spoiler_as_html.
2021-02-16 22:58:42 +00:00
Marnanel Thurman
061ce40101
Remote/local test for Status objects is remote_url__isnull
2021-02-15 18:24:48 +00:00
Marnanel Thurman
5bf75d6c98
Fixed expected results which were wrong
2021-02-15 18:24:34 +00:00
Marnanel Thurman
dbdad70376
LocalPerson.inbox uses Q objects rather than union(), because
...
union precludes filtering later.
See:
https://stackoverflow.com/questions/49260393/django-filter-a-queryset-made-of-unions-not-working
2021-02-15 18:21:57 +00:00
Marnanel Thurman
e77ce337c4
Heroic attempt to work with django_rest_framework instead of fighting against it.
...
Specifically, filter_queryset() does the filtering, and we don't attempt
to provide our own get() on a ListAPIView.
2021-02-14 22:03:37 +00:00
Marnanel Thurman
8eb2b2468d
Timelines tests pass GET params in via "data" and not literally in the path.
...
We start testing limits with limit=1 rather than limit=0, because it was
confusing the defaults mechanism further up. I'm not sure limit=0 is useful
anywhere at all.
And some minor fixes.
2021-02-14 22:01:43 +00:00
Marnanel Thurman
d4af44913b
TrilbyTestCase uses the "data" and "extra" params the same way as Django's test client
2021-02-14 22:00:18 +00:00
Marnanel Thurman
a9d03dd280
Shorten Status.__str__ because it gets overwhelming in the logs
2021-02-14 21:59:47 +00:00
Marnanel Thurman
6ae898af03
Inbox lookup for LocalPerson used the "follow" relationship backwards; now fixed.
2021-02-14 21:57:32 +00:00
Marnanel Thurman
3a3ce2fae2
Home timeline tests added
2021-02-09 18:06:04 +00:00
Marnanel Thurman
17519f62cb
split public and home timeline tests to separate classes
2021-02-09 17:42:10 +00:00
Marnanel Thurman
f40a6d862d
Many new timeline tests, per spec
2021-02-09 17:39:39 +00:00
Marnanel Thurman
312b3760fc
Started to put test_timelines in order. Each test sets up the statuses as it needs.
2021-02-07 20:30:03 +00:00
Marnanel Thurman
30f445aa3b
trilby_api/views.py split out into several modules in trilby_api/views/.
...
Tests all pass.
Verify_Credentials renamed to VerifyCredentials for consistency.
This is to make things easier when fixing issue #68 .
2021-02-02 20:08:32 +00:00
Marnanel Thurman
757132aa36
Status contents and user bios are returned as HTML.
...
I've implemented this with *_as_html accessors on the objects,
rather than doing it in the serialisers, so that we can easily
make them read/write if we need to.
Tests updated.
Closes issue #36 , and I think we're done with %shine.
2020-11-25 20:23:11 +00:00
Marnanel Thurman
e65450b9e7
trilby's find_local_view() can see through view_for_mimetype views.
...
Tests updated.
2020-11-25 20:22:20 +00:00
Marnanel Thurman
2e82f842e3
RemotePerson.followers and RemotePerson.following both implemented in terms of the same helper function.
...
LocalPerson.followers moved to Person.followers, where it should always have been.
RemotePerson.followers overrides this, just as RemotePerson.following overrides Person.following.
Closes issue #64 .
2020-11-16 02:19:03 +00:00
Marnanel Thurman
1d9c630f11
move login.html from trilby to tophat, and add our template includes
2020-11-12 17:46:51 +00:00
Marnanel Thurman
dae5017e3d
LocalPerson gains get_followers_collection() and get_following_collection(),
...
which are aliases for the followers and following properties.
This isn't elegant, but it makes the views easier. When we fix
issue 64, we should return to the question of these accessors
for Persons in general.
2020-10-31 17:42:51 +00:00
Marnanel Thurman
46e55a740a
Added @skip back in to all the remaining NotImplementedError stub tests.
...
I'm doing this because otherwise this branch becomes impossible to
merge with main until it's completely ready.
2020-10-30 23:05:25 +00:00
Marnanel Thurman
8e3f23ac92
Not implementing /peers or /activity instance methods any time soon tbh
2020-10-30 22:53:46 +00:00
Marnanel Thurman
622fc69df9
test_account: added @skips back in again for block/muting because those aren't yet written; deleted some test stubs of obscure purpose.
2020-10-29 23:19:37 +00:00
Marnanel Thurman
949cd70f1b
Merge branch 'mentions' into issue-47
2020-10-29 17:59:30 +00:00
Marnanel Thurman
731cb3e21e
trilby doesn't need to return mentions, at least not for now
2020-10-29 17:58:50 +00:00
Marnanel Thurman
38eac12111
Status gains to and cc properties, both currently stubs
2020-10-29 16:43:54 +00:00
Marnanel Thurman
b193096666
Status.tags() returns a list, not a QuerySet
2020-10-29 16:31:15 +00:00
Marnanel Thurman
3db8b2a43f
Merge branch 'mentions' into issue-47
2020-10-29 04:23:06 +00:00
Marnanel Thurman
297d3cbf56
Status returns mentions correctly
2020-10-29 04:17:35 +00:00
Marnanel Thurman
53e157dc6a
added Mention class
2020-10-29 04:17:22 +00:00
Marnanel Thurman
c797fdaf74
fix header comment error
2020-10-29 03:24:15 +00:00
Marnanel Thurman
f1822f668e
test_search: @skips removed; class renamed to Tests per policy
2020-10-29 03:18:32 +00:00
Marnanel Thurman
930deeb360
Merge branch 'tombstones' into issue-47
2020-10-29 01:54:20 +00:00
Marnanel Thurman
d044415053
add "gone" field to LocalPerson
2020-10-29 01:53:01 +00:00
Marnanel Thurman
63aba5e743
rm "deleted" signal
2020-10-29 01:52:28 +00:00
Marnanel Thurman
c4c175738f
Merge branch 'status-serialisers' into issue-47
2020-10-29 01:00:57 +00:00
Marnanel Thurman
88bef76a14
add "activity_url" property to Status, and corresponding STATUS_ACTIVITY_URL template to settings
2020-10-29 00:27:46 +00:00
Marnanel Thurman
bbb0fc278a
added missing "self" in Like.__str__()
2020-10-27 18:32:14 +00:00
Marnanel Thurman
0d5b665434
LocalPerson gains has_liked(). Tests updated.
2020-10-27 18:19:29 +00:00