Consistent database context usage in tests

- Changed context variable declarations to more specific ones, based on
the used context.
- Removed context recreation in a middle of the tests.