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
Thomas Thurman
07875e03ab
config error, marnanel.org specific
2023-09-22 16:36:22 +01:00
Marnanel Thurman
77b45772bb
Update to new version of celery (so djcelery is removed).
...
This seems to involve unsetting TEST_RUNNER. I'm not certain
this is correct; I'm asking on IRC.
2021-05-31 19:13:07 +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
02688a8422
obsolete url() -> path()
2021-02-19 19:31:50 +00:00
Marnanel Thurman
ebc4052495
Rewrite oauth2 entries in urls.py. They were wrong, and this should
...
have fixed issue 70, but it doesn't.
2021-02-18 20:30:02 +00:00
Marnanel Thurman
6174859722
Merge branch 'issue-68' into 'main'
...
Issue 68
See merge request marnanel/chapeau!2
2021-02-18 20:26:57 +00: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
63955031e5
static/ added to .gitignore
2021-02-02 20:10:36 +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
60b70f9cee
"/home" served, but with nothing very interesting on it
2021-01-10 21:46:38 +00:00
Marnanel Thurman
98a5bde0b2
Display username in the navbar, and logout link, if you're logged in
2021-01-05 21:59:18 +00:00
Marnanel Thurman
4ef96ea6db
LOGOUT_REDIRECT_URL
2021-01-05 21:56:26 +00:00
Marnanel Thurman
7e763ed4bf
LOGIN_REDIRECT_URL set
2021-01-05 21:47:37 +00:00
Marnanel Thurman
99981e3baf
login stuff moved to /accounts/login (from /login) so we can use auth's urls.py in a separate subdir
2021-01-05 21:45:34 +00:00
Marnanel Thurman
2198350394
INSTANCE_BLURB. Closes issue #66 .
2021-01-04 02:57:17 +00:00
Marnanel Thurman
eb4ec809bb
Version bump to 0.7 (%shine)
2020-11-25 20:26:45 +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
2e794e2a8a
bowler's tests gain BowlerClient, a subclass of django.test.Client
...
which will set the Accept param correctly on get requests.
Used throughout test_views instead of d.t.Client.
2020-11-25 20:20:55 +00:00
Marnanel Thurman
7b37822d8d
As a special case, view_for_mimetype returns the view list if the request param is None.
...
Tests updated.
2020-11-25 20:20:00 +00:00
Marnanel Thurman
e0517f6688
test_headers supplies correct Accept header.
...
Class name changed to Tests per coding standard.
2020-11-25 19:40:53 +00:00
Marnanel Thurman
ac9fb3d2bf
sombrero's fake HttpRequest for ACTIVITY_GET requests supplies an Accept header.
...
Otherwise it doesn't get routed to the right view now that we route based on Accept.
2020-11-25 19:36:48 +00:00
Marnanel Thurman
0b98be76c4
fix logging statement
2020-11-25 19:34:28 +00:00
Marnanel Thurman
0e15db00da
User page is HTML or JSON depending on Accept header.
...
Closes issue #48 .
2020-11-25 18:46:31 +00:00
Marnanel Thurman
5e6a4a1721
Templates for previous commits which I forgot to stage
2020-11-25 18:46:15 +00:00
Marnanel Thurman
a0fe164ae1
tophat gains UserPage view.
...
Slight tidying of StatusPage view.
2020-11-25 18:44:57 +00:00
Marnanel Thurman
6f033b7928
Status pages are HTML or JSON depending on Accept header.
2020-11-25 18:36:07 +00:00