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)
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
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
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
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
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
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
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']