from django.test import TestCase

from ocyan.plugin.wagtail_oscar_integration.blocks import ProductChooserBlock


class ProductChooserBlockTestCase(TestCase):
    def test_value_from_form_empty(self):
        block = ProductChooserBlock(required=False)
        self.assertEqual(block.clean(""), None)
        self.assertEqual(block.value_from_form(None), None)
