コード例 #1
0
    def test_post_save_when_no_aq_project(self):

        project = ProjectFactory.create(status='active')

        project.status = 'deleted'
        project.save

        post_save_project(Project, instance=project)

        self.assertEquals(len(mail.outbox), 0)
コード例 #2
0
    def test_post_save_when_no_aq_project(self):

        project = ProjectFactory.create(status='active')

        project.status = 'deleted'
        project.save

        post_save_project(Project, instance=project)

        self.assertEquals(len(mail.outbox), 0)
コード例 #3
0
    def test_post_save_when_project_made_deleted(self):

        project = ProjectFactory.create(status='active')
        aq_project = AirQualityProjectFactory.create(project=project)

        project.status = 'deleted'
        project.save

        post_save_project(Project, instance=project)

        self.assertEqual(
            AirQualityProject.objects.filter(pk=aq_project.id).exists(), False)
        self.assertEquals(len(mail.outbox), 1)
コード例 #4
0
    def test_post_save_when_project_made_deleted(self):

        project = ProjectFactory.create(status='active')
        aq_project = AirQualityProjectFactory.create(project=project)

        project.status = 'deleted'
        project.save

        post_save_project(Project, instance=project)

        self.assertEqual(
            AirQualityProject.objects.filter(pk=aq_project.id).exists(),
            False
        )
        self.assertEquals(len(mail.outbox), 1)