def test_can_use_global_ status self self client force_authenticate se

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
def test_can_use_global_status(self):
self.client.force_authenticate(self.user)
user_org = OrganizationMembership.objects.get_primary(self.user).organization
sub_matter = SubMatterFactory(matter__organization=user_org)
task_status = TaskStatusFactory(organization=None)
res = self._post_request(sub_matter=sub_matter.pk, status=task_status.pk)
self.assertEqual(res.status_code, status.HTTP_200_OK, res.data)
self.assertEqual(res.data['status'], task_status.pk)