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

def test_paste_spin(self):

    spin = self.spin
    for (end, ans) in ((0, 'onetwo'), ('end', 'two')):
        with self.subTest(end=end, ans=ans):
            spin.delete(0, 'end')
            spin.insert(0, 'one')
            spin.selection('range', 0, end)
            spin.event_generate('<<Paste>>')
            self.assertEqual(spin.get(), ans)
