|
|
@@ -68,6 +68,19 @@ class TestBooleanAttributes(TestCase):
|
|
68
|
68
|
with self.assertRaises(ValidationError):
|
|
69
|
69
|
self.attr.validate_value(1)
|
|
70
|
70
|
|
|
|
71
|
+ def test_boolean_value_as_text_true(self):
|
|
|
72
|
+ product = factories.ProductFactory()
|
|
|
73
|
+ self.attr.save_value(product, True)
|
|
|
74
|
+ attr_val = product.attribute_values.get(attribute=self.attr)
|
|
|
75
|
+ assert attr_val.value_as_text == "Yes"
|
|
|
76
|
+
|
|
|
77
|
+ def test_boolean_value_as_text_false(self):
|
|
|
78
|
+ product = factories.ProductFactory()
|
|
|
79
|
+ self.attr.save_value(product, False)
|
|
|
80
|
+ attr_val = product.attribute_values.get(attribute=self.attr)
|
|
|
81
|
+ assert attr_val.value_as_text == "No"
|
|
|
82
|
+
|
|
|
83
|
+
|
|
71
|
84
|
|
|
72
|
85
|
class TestMultiOptionAttributes(TestCase):
|
|
73
|
86
|
|