forked from mirrors/bookwyrm
Fixes interaction tests
This commit is contained in:
parent
52adfbf5da
commit
ef71da7ef0
2 changed files with 14 additions and 5 deletions
|
@ -83,6 +83,9 @@ class InteractionViews(TestCase):
|
|||
with patch("bookwyrm.activitystreams.ActivityStream.add_status"):
|
||||
status = models.Status.objects.create(user=self.local_user, content="hi")
|
||||
|
||||
with patch(
|
||||
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
|
||||
):
|
||||
view(request, status.id)
|
||||
|
||||
boost = models.Boost.objects.get()
|
||||
|
@ -157,6 +160,9 @@ class InteractionViews(TestCase):
|
|||
with patch("bookwyrm.activitystreams.ActivityStream.add_status"):
|
||||
status = models.Status.objects.create(user=self.local_user, content="hi")
|
||||
|
||||
with patch(
|
||||
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
|
||||
):
|
||||
view(request, status.id)
|
||||
view(request, status.id)
|
||||
self.assertEqual(models.Boost.objects.count(), 1)
|
||||
|
@ -168,6 +174,9 @@ class InteractionViews(TestCase):
|
|||
request.user = self.remote_user
|
||||
with patch("bookwyrm.activitystreams.ActivityStream.add_status"):
|
||||
status = models.Status.objects.create(user=self.local_user, content="hi")
|
||||
with patch(
|
||||
"bookwyrm.activitystreams.ActivityStream.remove_object_from_related_stores"
|
||||
):
|
||||
views.Boost.as_view()(request, status.id)
|
||||
|
||||
self.assertEqual(models.Boost.objects.count(), 1)
|
||||
|
|
2
bw-dev
2
bw-dev
|
@ -84,7 +84,7 @@ case "$CMD" in
|
|||
runweb coverage run --source='.' --omit="*/test*,celerywyrm*,bookwyrm/migrations/*" manage.py test "$@"
|
||||
;;
|
||||
pytest)
|
||||
runweb pytest --no-cov-on-fail "$@"
|
||||
execweb pytest --no-cov-on-fail "$@"
|
||||
;;
|
||||
collectstatic)
|
||||
runweb python manage.py collectstatic --no-input
|
||||
|
|
Loading…
Reference in a new issue