SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit bf4d12aa authored by George Katsikas's avatar George Katsikas :goat:
Browse files

remove print output from tests

parent cf7dd3b5
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,7 @@ class Command(BaseCommand):
auth=("api", settings.MAILGUN_API_KEY),
data=data,
)
print(data)
print(response)
except Domain.MultipleObjectsReturned:
raise APIMailError("Multiple domains found in mailgun_send_test_email")
except Domain.DoesNotExist:
......
......@@ -245,7 +245,6 @@ class TestRequestArxivPreprintForm(TestCase):
**{"arxiv_identifier": random_arxiv_identifier_with_version_number},
}
)
print("form.errors:\n\t%s" % form.errors)
self.assertTrue(form.is_valid())
def test_identifier_that_already_has_commentary_page_is_invalid(self):
......
......@@ -34,4 +34,3 @@ class MailLogFilesTests(TestCase):
except Exception as e:
self.fail('Mail ("{}") configuration invalid:\n{}'.format(mail_code, e))
i += 1
print("Tested {} files".format(i))
from contextlib import redirect_stdout
from io import StringIO
from django.core.management import call_command
from django.test import TestCase
......@@ -87,7 +89,13 @@ class ModelEmailBackendTests(TestCase):
mail_util.send_mail()
mail_log = MailLog.objects.last()
call_command("send_mails", id=mail_log.id)
# Capture stdout to check for command output.
stdout = StringIO()
with redirect_stdout(stdout):
call_command("send_mails", id=mail_log.id)
self.assertIn("Sent 1 mails.", stdout.getvalue())
mail_log.refresh_from_db()
self.assertNotEqual(mail_log.body, "")
......
......@@ -50,7 +50,5 @@ class TestRequestThesisLink(TestCase):
form = RequestThesisLinkForm(form_data, request=self.request)
# Check if the user is properly saved to the new ThesisLink as `requested_by`
print(form.is_valid())
print(form.errors)
thesislink = form.save()
self.assertEqual(thesislink.requested_by, self.contributor)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment