898fe40 frontend: fix PinnedCoprsForm validation

2 files Authored by frostyx 3 years ago, Committed by praiskup 3 years ago,
    frontend: fix PinnedCoprsForm validation
    
    Fix #1485
    Superseed PR#1495
    
    Form `errors` dictionary cannot be modified directly. We need to append to
    `errors` properties of specific fields. As a consequence, we cannot have errors
    for non-existing fields - in this case `"coprs"`. Also, to be able to set errors
    at all, `validate()` method of the parent class needs to be called first.
    
    The `SelectMultipleField` tries to validate its `choices` and fails
    because we didn't and can't set any. They need to by dynamically
    generated from the database later. Therefore let's just skip the
    default validation by using a custom field.
    
    Lastly, I am updating the tests a bit because the new WTForms doesn't
    allow us to modify a data of an existing form, so they need to be
    passed when creating it.