Code dedup in test_update_*

Moved shared code that forms a request to separate function.

bp nova-tests-code-duplication

Change-Id: Ie112fafe1085c883446adef1fc5ff4c29e76361f
Merge "Code dedup in test_update_*"