result.canonical is a dict not a callable.
Abstracted out the patching of the Device model to be DRY.
Added a basic test for the GCM code using mocks.