Exemplo n.º 1
0
    def test_list_reports_shared_with_organization(self):
        read = factories.Read(read_name="test_data",
                              owner=self.tola_user.user)

        factories.Silo(name='Test Share Report',
                       owner=self.tola_user.user,
                       reads=[read],
                       public=False,
                       shared=[],
                       share_with_organization=True)

        request = self.factory.get('')
        request.user = self.tola_user.user
        response = views.list_table_dashboards(request)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, 'Test Share Report')
Exemplo n.º 2
0
    def test_list_reports_not_share_with_organization(self):
        request_user = factories.User(username='******')
        factories.TolaUser(user=request_user,
                           organization=self.hikaya_user.organization)

        read = factories.Read(read_name="test_data",
                              owner=self.hikaya_user.user)

        factories.Silo(name='Test Share Report',
                       owner=self.hikaya_user.user,
                       reads=[read],
                       public=False,
                       shared=[],
                       share_with_organization=False)

        request = self.factory.get('')
        request.user = request_user
        response = views.list_table_dashboards(request)
        self.assertEqual(response.status_code, 200)
        self.assertNotContains(response, 'Test Share Report')