def test_commands_create_demo_site_method(self, *_):
     """
     Validate that the create_demo_site method works (with a minimum number of pages because
     it takes a lot of time).
     """
     create_demo_site()
     self.assertEqual(models.BlogPost.objects.count(), 2)
     self.assertEqual(models.Course.objects.count(), 2)
     self.assertEqual(models.CourseRun.objects.count(), 2)
     self.assertEqual(models.Category.objects.count(), 26)
     self.assertEqual(models.Organization.objects.count(), 2)
     self.assertEqual(models.Person.objects.count(), 2)
     self.assertEqual(models.Licence.objects.count(), 1)
     self.assertEqual(CMSPlugin.objects.count(), 420)
Beispiel #2
0
    def test_commands_create_demo_site_method(self, *_):
        """
        Validate that the create_demo_site method works (with a minimum number of pages because
        it takes a lot of time).
        """
        create_demo_site()
        self.assertEqual(models.BlogPost.objects.count(), 2)
        self.assertEqual(models.Course.objects.count(), 2)
        self.assertEqual(models.CourseRun.objects.count(), 2)
        self.assertEqual(models.Category.objects.count(), 48)
        self.assertEqual(models.Organization.objects.count(), 2)
        self.assertEqual(models.Person.objects.count(), 2)
        self.assertEqual(models.Licence.objects.count(), 1)
        self.assertEqual(models.Program.objects.count(), 2)

        self.assertEqual(Site.objects.first().domain, "richie.education:9999")
    def test_commands_create_demo_site_method(self, *_):
        """
        Validate that the create_demo_site method works (with a minimum number of pages because
        it takes a lot of time).
        """
        create_demo_site()
        self.assertEqual(models.BlogPost.objects.count(), 2)
        self.assertEqual(models.Course.objects.count(), 2)
        self.assertEqual(models.CourseRun.objects.count(), 2)
        self.assertEqual(models.Category.objects.count(), 48)
        self.assertEqual(models.Organization.objects.count(), 2)
        self.assertEqual(models.Person.objects.count(), 2)
        self.assertEqual(models.Licence.objects.count(),
                         TEST_NB_OBJECTS["licences"])
        self.assertEqual(models.Program.objects.count(), 2)
        self.assertTrue(
            models.CourseRun.objects.first().resource_link.startswith(
                "https://lms.richie.education:9999"))

        self.assertEqual(Site.objects.first().domain, "richie.education:9999")