'Test pasting into text with and without a selection.'

def test_paste_text(self):

    text = self.text
    for (tag, ans) in (('', 'onetwo\n'), ('sel', 'two\n')):
        with self.subTest(tag=tag, ans=ans):
            text.delete('1.0', 'end')
            text.insert('1.0', 'one', tag)
            text.event_generate('<<Paste>>')
            self.assertEqual(text.get('1.0', 'end'), ans)
