ldapBackend.py: Do user.save() after user-create's add-group

* When a user doesn't exist and needs to be populated from ldap, the
  user.save() is located inside the conditional code for setting
  LDAP_AUTH_GROUP. This commit moves it after that so the save() always
  happens (even if LDAP_AUTH_GROUP is set in settings.py it might bork
  before the save() if the group doesn't exist).

* Also moved it and the user.is_active assignment to after the
  "user-exists" try-except block, to be more DRY
Merge pull request #68 from rowanthorpe/fix-ldap-user-creation

ldapBackend.py: Do user.save() after user-create's add-group

LGTM. As a side note, I will be visiting this backend a bit more soon. I already got some unit tests for it and will try to increase them both to increase code coverage as well as traverse unvisited code paths to expose bugs. Thank you
LDAP authentication unit tests

Using mockldap, add user authentication unit tests with LDAP backend
Also fix a corner case with the filter not having parentheses in the
ldapBackend which had mockldap complain.
Fix bug in ldapBackend with LDAP_AUTH_GROUP

If LDAP_AUTH_GROUP was not defined in settings, ldapBackend would
raise an Exception making authentication impossible. Fix it using the
canonical way of checking for dictionary key existence
DRY optimization in ldapBackend

Just some simple code deduplication
Add some extra LDAP auth unit tests

A bad login
A not correctly created user but correct password
A malformed user
Fix regression with settings and LDAP_AUTH_GROUP

Introduced in 8af59df, it was NOT the canonical way of checking
check both codepaths when using LDAP auth

Both for an existing as well as a non existing user
Standardise some fields-when-empty in equipment rendering