| Conditions | 5 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from django.test import TestCase |
||
| 32 | @classmethod |
||
| 33 | def test_model_init_kwargs(cls): |
||
| 34 | """Tests whether all :see:LocalizedField |
||
| 35 | fields are assigned an empty :see:LocalizedValue |
||
| 36 | instance when the model is instanitiated.""" |
||
| 37 | data = { |
||
| 38 | 'title': { |
||
| 39 | 'en': 'english_title', |
||
| 40 | 'ro': 'romanian_title', |
||
| 41 | 'nl': 'dutch_title' |
||
| 42 | } |
||
| 43 | } |
||
| 44 | obj = cls.TestModel(**data) |
||
| 45 | |||
| 46 | assert isinstance(obj.title, LocalizedValue) |
||
| 47 | assert obj.title.en == 'english_title' |
||
| 48 | assert obj.title.ro == 'romanian_title' |
||
| 49 | assert obj.title.nl == 'dutch_title' |