MultipleObjectsReturned: get() returned more than one Permission -- it returned 2
<p>My tests are failing saying get() returned 2 permissions.. But I have not assigned 2 permissions anywhere. In my views m inheriting PermissionRequiredMixin from django.contrib.auth.mixins and assigning permission. Below is my test setUp code, where error is showing: </p>

<pre><code>def setUp(self):
        self.material = MaterialFactory.create()
        self.material_reorder = MaterialFactory.create(
            opening_stock=500, reorder_qty=1000)
        self.user = User.objects.create_user(
            'admin', 'lennon@thebeatles.com', 'admin')
        self.user.user_permissions.add(
            Permission.objects.get(codename="add_material"))
</code></pre>