def test_tasks_are_hidde n_after_archive self self client login userna

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def test_tasks_are_hidden_after_archive(self):
self.client.login(username=self.user.email, password='1234')
user_organization = OrganizationMembership.objects.get_primary(self.user).organization
sub_matter = SubMatterFactory(organization=user_organization, archived=True)
TaskFactory(sub_matter=sub_matter)
res = self.client.get(reverse('task-list'), {'sub_matter': sub_matter.pk})
self.assertEqual(len(res.data), 0)
self.assertEqual(res.status_code, status.HTTP_200_OK)
def test_financials_are_hidden_after_archive(self):
self.client.login(username=self.user.email, password='1234')
user_organization = OrganizationMembership.objects.get_primary(self.user).organization
sub_matter = SubMatterFactory(organization=user_organization, archived=True)
FinancialFactory(sub_matter=sub_matter)
res = self.client.get(reverse('financial-list'), {'sub_matter': sub_matter.pk})
self.assertEqual(len(res.data), 0)
self.assertEqual(res.status_code, status.HTTP_200_OK)