'Verify that new discussion can not be started during course blackout period.
Blackout period is the period between which students cannot post new or contribute
to existing discussions.'

def test_discussion_blackout_period(self):

    now = datetime.datetime.now(UTC)
    self.course_fixture.add_advanced_settings({u'discussion_blackouts': {'value': [[(now - datetime.timedelta(days=14)).isoformat(), (now + datetime.timedelta(days=2)).isoformat()]]}})
    self.course_fixture._add_advanced_settings()
    self.browser.refresh()
    thread = Thread(id=uuid4().hex, commentable_id=self.discussion_id)
    thread_fixture = SingleThreadViewFixture(thread)
    thread_fixture.addResponse(Response(id='response1'), [Comment(id='comment1')])
    thread_fixture.push()
    self.setup_thread_page(thread.get('id'))
    self.assertFalse(self.tab_nav.has_new_post_button_visible_on_tab())
    self.assertFalse(self.thread_page.has_add_response_button())
    self.assertFalse(self.thread_page.has_discussion_reply_editor())
    self.assertFalse(self.thread_page.is_response_editable('response1'))
    self.assertFalse(self.thread_page.is_response_deletable('response1'))
    self.assertFalse(self.thread_page.is_add_comment_visible('response1'))
    self.assertFalse(self.thread_page.is_comment_editable('comment1'))
    self.assertFalse(self.thread_page.is_comment_deletable('comment1'))
