From nobody Mon Feb 9 20:31:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187361; cv=none; d=zohomail.com; s=zohoarc; b=mmxbVfNpa/xFfk248EOvRFYokOqld1AzEyRSa2mmccNBcINndGFbn5VrIrDrypm/EN9bZOAq9ycaN6zcjR0/3ztksv5VctTMa/2fzulLWLF8D0LI9I5Yk3Y6rvj1YEeP0RCER+WssSpRipkD4AgUtxe3PXXcai9ayo3M4hrwIIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187361; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Yx1RXU+Fcq+ak/CPjdnsi1huHbYn6l6YUsGt3WH0mtQ=; b=f/biZhQTE0xJ9/dOkQ1Uj10+aNmpm35vcyxYb8b/xJ2JGckrzfbMZWZ/8/SF1sFa365NLcLoD+GGjW0DgTIX4QCicfg4IFjdYbktFFVghemIFw/4xUD/Aca8WH5tpdObzgvujXzu/4O3JJ+1O+7ahga2Fo1OI2miCTlyjfV+R7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157918736130013.117039701737326; Thu, 16 Jan 2020 07:09:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-DOqq6ylPOh-796iIbVoKfA-1; Thu, 16 Jan 2020 10:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1CE4477; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 961AE19C5B; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8C3CF18034EA; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9FWm024588 for ; Thu, 16 Jan 2020 10:09:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id D5C75842BA; Thu, 16 Jan 2020 15:09:15 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32F2780890 for ; Thu, 16 Jan 2020 15:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Yx1RXU+Fcq+ak/CPjdnsi1huHbYn6l6YUsGt3WH0mtQ=; b=dNh2I/DvXzcHuqvi29gPnmcLS2xNHM7eRRju7R6bPk3B7RlUhJp6G/cEPzIpMcUaHsic2Y yPuYGj3yV+opSAXttdkCOGUfC/uEM8xWJPDxdg4ITeD7o6RFzK8xSVamrwVE+jS6AxlQJd tGmqSs9BaW9P5mwx+z4201B4MtnKN40= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:02 +0100 Message-Id: <20200116150909.21388-3-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/9] test_message: just use a single from X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: DOqq6ylPOh-796iIbVoKfA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/test_message.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_message.py b/tests/test_message.py index 69dcde8..bc0a98d 100755 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -8,27 +8,26 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 +import json import time import datetime =20 from .patchewtest import PatchewTestCase, main =20 +from api.models import Message =20 -class ProjectTest(PatchewTestCase): + +class MessageTest(PatchewTestCase): def setUp(self): self.create_superuser() =20 def test_0_second(self): - from api.models import Message - message =3D Message() message.date =3D datetime.datetime.utcnow() age =3D message.get_age() self.assertEqual(age, "0 second") =20 def test_now(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime.fromtimestamp(time.time() + 100) message.date =3D dt @@ -36,8 +35,6 @@ class ProjectTest(PatchewTestCase): self.assertEqual(age, "now") =20 def test_1_day(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime.fromtimestamp(time.time() - 3600 * 25) message.date =3D dt @@ -45,8 +42,6 @@ class ProjectTest(PatchewTestCase): self.assertEqual(age, "1 day") =20 def test_asctime(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime(2016, 10, 22, 10, 16, 40) message.date =3D dt --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel