'Test that plugin position is saved after creation'

def test_plugin_order(self):

    page_en = api.create_page('PluginOrderPage', 'col_two.html', 'en', slug='page1', published=True, in_navigation=True)
    ph_en = page_en.placeholders.get(slot='col_left')
    text_plugin_1 = api.add_plugin(ph_en, 'TextPlugin', 'en', body="I'm    the    first")
    text_plugin_2 = api.add_plugin(ph_en, 'TextPlugin', 'en', body="I'm    the    second")
    db_plugin_1 = CMSPlugin.objects.get(pk=text_plugin_1.pk)
    db_plugin_2 = CMSPlugin.objects.get(pk=text_plugin_2.pk)
    with self.settings(CMS_PERMISSION=False):
        self.assertEqual(text_plugin_1.position, 0)
        self.assertEqual(db_plugin_1.position, 0)
        self.assertEqual(text_plugin_2.position, 1)
        self.assertEqual(db_plugin_2.position, 1)
        rendered_placeholder = ph_en.render(self.get_context(page_en.get_absolute_url(), page=page_en), None)
        self.assertEqual(rendered_placeholder, "I'm    the    firstI'm    the    second")
