Fixed #22811 -- Allowed setting both the old and new TEST database settings.

https://code.djangoproject.com/ticket/22811
There are two issues I see with this: 

In terms of code, the `elif key=='TEST'`executed for every key that isn't TEST_* is a little funny.
In terms of semantics, you assume that not including a value in the dict is the same as setting it to None, which isn't true (e.g. `TEST['CREATE_DB']` is a Boolean which defaults to True ).

I think it is better to do something like (untested)
```python
test_settings = conn.setdefault('TEST', {})
old_test_settings = {}
for key, value in six.iteritems(conn):
    if key.startswith('TEST_'):
        new_key = key[5:]
        new_key = self.TEST_SETTING_RENAMES.get(new_key, new_key)
        old_test_settings[new_key] = value
if old_test_settings:
   if test_settings:
      if test_settings!=old_test_settings:
         raise ImproperlyConfigured(...) 
   else: #not test_settings
       test_settings = old_test_settings
       warnings.warn(...)
# now test_settings can be used
```
This doesn't pin exactly any mismatch, but that can be done only when an error has been detected (and then TEST_SETTING_RENAMES_REVERSE may still be useful)