order = Order.objects.get(id = order_id) # заказы
order = order.work.all() # итерируемая структура как указано тут https://stackoverflow.com/questions/9575310/how-can-i-iterate-over-manytomanyfield
reult = filter(lambda m:len(set(m.work) - set(order)) == len(m)-len(order), Master.objects.all())
An Espresso is really good and fast test automation framework, which allows you test many things inside your application in simple way.
A UiAutomator is perfect framework for automation testing outside of application because this framework allows test many system stuff, as example notification, access to any application, etc.