Wykres commitów

27 Commity (c8a5b5308b7bbc25b503b9ff3c0ebf8fcb2250b4)

Autor SHA1 Wiadomość Data
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 4fbad0a949 Removed loads of @skip decorators from tests, as part of issue 47.
Tests now fail quite a lot. :)
2020-10-26 22:29:55 +00:00
Marnanel Thurman ebe785bda4 rm trailing newlines (pylint C0304) 2020-09-19 15:16:47 +01:00
Marnanel Thurman 64b9116e6c API urls use the primary key of the Person table and not the username! 2020-04-25 17:20:22 +01:00
Marnanel Thurman 3858c95426 Content of statuses, and notes (bios) of users, are interpreted as markdown
and returned as HTML.
2020-04-25 16:40:06 +01:00
Marnanel Thurman 7d4158ec02 "acct" is just the username for local accounts 2020-04-23 20:07:27 +01:00
Marnanel Thurman 7a4a278f0e user "id" field is an int 2020-04-23 19:38:18 +01:00
Marnanel Thurman 83ebca57ad rm unused constant 2020-04-22 17:02:32 +01:00
Marnanel Thurman bbe00656d2 kepi.trilby_api.tests.__init__ no longer has standalone "get" and "post" functions.
test_notifications no longer depends on httpretty.
2020-04-22 17:00:26 +01:00
Marnanel Thurman d80ae73e5c test_integration and test_rest merged into the other tests;
some tests still breaking
2020-04-16 16:39:38 +01:00
Marnanel Thurman 0f8937b917 On trilby tests:
- tests which were expecting 201 now expect 200.
 - test_instance, all stubs
 - test_search, all stubs
 - many new stubs so we have (stub) API coverage
2020-04-16 16:22:45 +01:00
Marnanel Thurman 5021f60431 intermediate 2020-04-03 17:57:03 +01:00
Marnanel Thurman 5b012e0f6c intermediate 2020-03-31 02:11:57 +01:00
Marnanel Thurman 2c2b8cc67f intermediate 2020-03-29 18:09:19 +01:00
Marnanel Thurman 0e920c6906 intermediate 2020-03-29 17:59:28 +01:00
Marnanel Thurman 136c013879 intermediate 2020-03-28 18:32:25 +00:00
Marnanel Thurman d1ecc330d1 intermediate 2020-03-28 16:15:45 +00:00
Marnanel Thurman 3e6596b800 intermediate 2020-03-27 22:38:05 +00:00
Marnanel Thurman 600d13d4f5 intermediate 2020-03-20 15:47:05 +00:00
Marnanel Thurman e07706865e Intermediate checkin 2020-03-16 17:54:02 +00:00
Marnanel Thurman 9fa7031f5f Trilby's status numbers are now the numbers of the actual AcItem,
not the AcCreate which created it.

Suddenly, all the code is clearer.
2020-02-28 00:53:24 +00:00
Marnanel Thurman 2bc69c1250 The "serial" field of bowler_pub's AcItem moves up to AcObject;
all objects, remote and local, now have serial numbers.

This is partly to make it easier for trilby_api to provide
decimal "id" numbers, and partly so that status URLs can contain
monotonically increasing decimal numbers. This last part
has not yet been implemented; status URLs still contain the
hex ID of the status.

It's possible that we can simplify this design a bit;
we should think about refactoring.

The regexp for local hex numbers is renamed to LOCAL_NUMBER_REGEXP
because it used to contain the word "SERIAL", which was misleading.

trilby_api now returns the "serial" field as "id"; see above.

Tests updated.
2020-02-04 01:38:54 +00:00
Marnanel Thurman 25a1b40461 "acct" returns simply the account name for local accounts,
and preferredUsername@hostname for remote accounts.

This change was suggested at
https://socialhub.activitypub.rocks/t/verify-credentials-im-doing-something-wrong-here/440/2
2020-01-23 01:52:26 +00:00
Marnanel Thurman c014bd6408 added on_like handler to create a "favourited" notification, plus test 2019-12-19 21:02:20 +00:00
Marnanel Thurman fa6e49bf43 Mastodon's notifications give a dict for account and status, not just their ID 2019-12-19 18:51:17 +00:00
Marnanel Thurman 5694851bcd In trilby_api.models
====================

Notification uses constants within the class
to represent notification types, as the docs recommend, rather than
using enum.Enum.

Notification.about_account is added. The existing "account" field
is renamed for_account for clarity.

Notification also gains a __str__() method.

on_follow modified to work properly with these changes.

Several migrations added. Note that trilby's 0006 migration is
deleted but there's a new 0006; you might have to wind back to
0005 to allow this migration to work. There are dependency
reasons for doing it like this.

In trilby_api.serializers
=========================

NotificationSerializer modified to return about_account.
It also gets immediately monkey-patched to return
notification_type as "type". Rather messy hack,
but StackExchange says this is the way to do it.

In trilby_api.views
===================

Notifications requires authentication(!) and returns
only the authenticated user's notifications.

In tests
========

test_notifications's test_follow fixed. It didn't work
before, despite the claim in commit 37095e; that was wrong
because the results weren't actually being checked.
2019-12-18 18:06:51 +00:00
Marnanel Thurman 37095e6f1d trilby integration with signals so on_follow notifications work.
Test for this passes; moving it to new test_notifications.py.
2019-12-18 16:30:56 +00:00