How to use the wagtailvideos.models.Video.objects.create function in wagtailvideos

To help you get started, we’ve selected a few wagtailvideos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neon-jungle / wagtailvideos / tests / test_template_tag.py View on Github external
def setUp(self):
        self.video = Video.objects.create(
            title="Test Video",
            file=create_test_video_file()
        )
github neon-jungle / wagtailvideos / tests / test_admin_views.py View on Github external
def setUp(self):
        self.login()

        # Create an video for running tests on
        self.video = Video.objects.create(
            title="Test video",
            file=create_test_video_file(),
        )
github neon-jungle / wagtailvideos / tests / test_admin_views.py View on Github external
def setUp(self):
        self.login()

        self.video = Video.objects.create(
            title="Test video",
            file=create_test_video_file(),
        )
github neon-jungle / wagtailvideos / tests / test_admin_views.py View on Github external
def test_pagination_after_upload_form_error(self):
        for i in range(0, 20):
            Video.objects.create(
                title="Test video %d" % i,
                file=create_test_video_file(),
            )

        response = self.client.post(reverse('wagtailvideos:chooser_upload'), {
            'title': "Test video",
        })

        self.assertEqual(response.status_code, 200)
        self.assertTemplateUsed(response, 'wagtailvideos/chooser/chooser.html')

        # The re-rendered video chooser listing should be paginated
        self.assertContains(response, "Page 1 of ")
        self.assertEqual(12, len(response.context['videos']))
github neon-jungle / wagtailvideos / tests / test_admin_views.py View on Github external
def test_filter_by_tag(self):
        for i in range(0, 10):
            video = Video.objects.create(
                title="Test video %d is even better than the last one" % i,
                file=create_test_video_file(),
            )
            if i % 2 == 0:
                video.tags.add('even')

        response = self.get({'tag': "even"})
        self.assertEqual(response.status_code, 200)

        # Results should include videos tagged 'even'
        self.assertContains(response, "Test video 2 is even better")

        # Results should not include videos that just have 'even' in the title
        self.assertNotContains(response, "Test video 3 is even better")