'Test the cleaned_metadata property.'

def test_cleaned_metadata(self):

    data = {'title': 'Lorem', 'content': 'ipsum', 'email': 't@t.com'}
    product = {'key': 'desktop', 'name': 'Firefox    on    desktop', 'extra_fields': ['troubleshooting', 'ff_version', 'os', 'plugins']}
    form = NewQuestionForm(product=product, data=data)
    form.is_valid()
    expected = {}
    actual = form.cleaned_metadata
    eq_(expected, actual)
    data['os'] = u'Linux'
    form = NewQuestionForm(product=product, data=data)
    form.is_valid()
    expected = {'os': u'Linux'}
    actual = form.cleaned_metadata
    eq_(expected, actual)
    data['ff_version'] = u''
    form = NewQuestionForm(product=product, data=data)
    form.is_valid()
    expected = {'os': u'Linux'}
    actual = form.cleaned_metadata
    eq_(expected, actual)
