Example #1
0
    def test_8_get_detail_closing_time(self):
        hearing = Hearing()
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert_datetime_fuzzy_equal(data['close_at'], hearing.close_at)
Example #2
0
    def test_8_get_detail_n_comments(self):
        hearing = Hearing(n_comments=1)
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['n_comments'] == hearing.n_comments
Example #3
0
    def test_8_get_detail_borough(self):
        hearing = Hearing(borough='Itäinen')
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['borough'] == hearing.borough
Example #4
0
    def test_8_get_detail_heading(self):
        hearing = Hearing(heading='Lorem Ipsum Heading')
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['heading'] == hearing.heading
Example #5
0
    def test_8_get_detail_abstract(self):
        hearing = Hearing(abstract='Lorem Ipsum Abstract')
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['abstract'] == hearing.abstract
Example #6
0
    def test_7_get_detail_servicemap(self):
        hearing = Hearing(
            servicemap_url='http://servicemap.hel.fi/embed/?bbox=60.19276,24.93300,60.19571,24.94513&city=helsinki')
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['servicemap_url'] == hearing.servicemap_url
Example #7
0
    def test_7_get_detail_location(self):
        hearing = Hearing(latitude='60.19276', longitude='24.93300')
        hearing.save()

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert data['latitude'] == hearing.latitude
        assert data['longitude'] == hearing.longitude
Example #8
0
    def test_8_get_detail_labels(self):
        hearing = Hearing()
        hearing.save()

        label_one = Label(label='Label One')
        label_one.save()
        label_two = Label(label='Label Two')
        label_two.save()
        label_three = Label(label='Label Three')
        label_three.save()

        hearing.labels.add(label_one, label_two, label_three)

        response = self.client.get(self.get_detail_url(hearing.id))
        assert response.status_code is 200

        data = self.get_data_from_response(response)

        assert 'results' not in data
        assert len(data['labels']) is 3
        assert label_one.label in data['labels']