@pytest.mark.django_db
def test_social_media_plugin_ordering():
 context = get_jinja_context()
 icon_classes = SocialMediaLinksPlugin.icon_classes
 link_1_type = 'Facebook'
 link_1 = {'url': 'http://www.facebook.com', 'ordering': 2}
 link_2_type = 'Twitter'
 link_2 = {'url': 'http://www.twitter.com', 'ordering': 1}
 links = {link_1_type: link_1, link_2_type: link_2}
 plugin = SocialMediaLinksPlugin({'links': links})
 assert (len(plugin.get_links()) == 2)
 assert (plugin.get_links()[0][2] == link_2['url'])

@ pytest . mark . django_db def test_social_media_plugin_ordering ( ) : context = get_jinja_context ( ) icon_classes = SocialMediaLinksPlugin . icon_classes link_1_type = 'Facebook' link_1 = { 'url' : 'http://www.facebook.com' , 'ordering' : 2 } link_2_type = 'Twitter' link_2 = { 'url' : 'http://www.twitter.com' , 'ordering' : 1 } links = { link_1_type : link_1 , link_2_type : link_2 } plugin = SocialMediaLinksPlugin ( { 'links' : links } ) assert ( len ( plugin . get_links ( ) ) == 2 ) assert ( plugin . get_links ( ) [ 0 ] [ 2 ] == link_2 [ 'url' ] )
test that social media plugin ordering works as expected .