def setUp(self): self.res_rss = AutoImportResource.objects.create( title='Test2', link='http://planetpython.org/rss20.xml', type_res='rss') self.section = Section(title='Статьи') self.section.save() test_name = 'fixture_test_import_news_test_rss.txt' self.patcher = patch('digest.management.commands.urlopen') self.urlopen_mock = self.patcher.start() self.urlopen_mock.return_value = MockResponse(read_fixture(test_name))
def test_type(self): section = Section(title='Статьи') object = Item(title='Title1', link='https://pythondigest.ru', section=section)