1👍
✅
You can prepopulate data in Database, For better understanding, you can follow this link.
And then simply test your method shown below:
class TestOrderModelMethods:
def test_get_order_from_status(self):
assertQuerysetEqual(
Order.get_order_from_status(params='waiting', queryset=Order.objects.all()),
Order.objects.filter(status='waiting'),
ordered=False)
Source:stackexchange.com