@transaction.autocommit
    def test_phpbb_parser(self):
        create_channel_db('project1', 'cf', 'coreforum',
                'channel.syncer.common_syncers.PHPBBForumSyncer',
                'channel.parser.common_parsers.PHPBBForumParser',
                'https://forum.hibernate.org/viewforum.php?f=1'
                )
        create_channel_local('project1', 'coreforum',
                'channel.syncer.common_syncers.PHPBBForumSyncer',
                'https://forum.hibernate.org/viewforum.php?f=1'
                )
        pname = 'project1'
        cname = 'coreforum'
        toc_refresh(pname, cname)
        toc_download_section(pname, cname, start=0, end=2)
        toc_download_entries(pname, cname, 1023, 1025)
        parse_channel(pname, cname, True)
        self.assertEqual(23, Message.objects.all().count())
        messages = list(Message.objects.all())
        for message in messages:
            print(message.url)
            print('{0} by {1} on {2} (wc: {3})'.format(
                message.title, message.author, message.msg_date,
                message.word_count))
            print('  {0} snippets and {1} references'.format(
                message.code_snippets.count(),
                message.code_references.count()))
            print('  Snippets:')
            for code_snippet in message.code_snippets.all():
                print('    {0}'.format(code_snippet.language))

            for ref in message.code_references.all():
                print('    {0}: {1}'.format(ref.kind_hint.kind, ref.content))
        
        # Test Snippets
        first_message = messages[0]
        self.assertEqual('x', first_message.code_snippets.all()[0].language)

        # Test Author
        self.assertEqual(first_message.author.nickname, 'mhellkamp')

        # Test Date
        self.assertEqual(first_message.msg_date, datetime(2003, 8, 29, 10, 16))

        # Test Refs
        second_message = messages[1]
        refs = [ref.content.strip() for ref in
                second_message.code_references.all()]
        # Title is not counted.
        self.assertEqual(4, len(refs))
        self.assertTrue(refs in 'DBCP')
        self.assertTrue('C3P0' in refs)
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/channel/tests.py/ChannelParserTest.test_phpbb_parser/swapped operands of `in`