# Path: django_toolkit/markup/html.py
# def get_anchor_href(markup):
#     """
#     Given HTML markup, return a list of hrefs for each anchor tag.
#     """
#     soup = BeautifulSoup(markup, 'lxml')
#     return ['%s' % link.get('href') for link in soup.find_all('a')]
# 
# def get_anchor_contents(markup):
#     """
#     Given HTML markup, return a list of href inner html for each anchor tag.
#     """
#     soup = BeautifulSoup(markup, 'lxml')
#     return ['%s' % link.contents[0] for link in soup.find_all('a')]


from django.utils import unittest
from django_toolkit.markup.html import get_anchor_href, get_anchor_contents


class HtmlGetAnchorHrefTestCase(unittest.TestCase):

    def test_finds_single_href(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a>'),
            [u'http://example.com']
        )

    def test_finds_two_hrefs(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a><a href="http://example2.com">Test 2</a>'),
            [u'http://example.com', u'http://example2.com']
        )

    def test_finds_two_duplicates(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a><a href="http://example.com">Test 2</a>'),
            [u'http://example.com', u'http://example.com']
        )

    def test_finds_hrefs_inside_otherstuff(self):
        self.assertEquals(

# Path: django_toolkit/markup/html.py
# def get_anchor_href(markup):
#     """
#     Given HTML markup, return a list of hrefs for each anchor tag.
#     """
#     soup = BeautifulSoup(markup, 'lxml')
#     return ['%s' % link.get('href') for link in soup.find_all('a')]
# 
# def get_anchor_contents(markup):
#     """
#     Given HTML markup, return a list of href inner html for each anchor tag.
#     """
#     soup = BeautifulSoup(markup, 'lxml')
#     return ['%s' % link.contents[0] for link in soup.find_all('a')]


# Path: django_toolkit/tests/markup.py
from django.utils import unittest
from django_toolkit.markup.html import get_anchor_href, get_anchor_contents



class HtmlGetAnchorHrefTestCase(unittest.TestCase):

    def test_finds_single_href(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a>'),
            [u'http://example.com']
        )

    def test_finds_two_hrefs(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a><a href="http://example2.com">Test 2</a>'),
            [u'http://example.com', u'http://example2.com']
        )

    def test_finds_two_duplicates(self):
        self.assertEquals(
            get_anchor_href('<a href="http://example.com">Test</a><a href="http://example.com">Test 2</a>'),
            [u'http://example.com', u'http://example.com']
        )

    def test_finds_hrefs_inside_otherstuff(self):
        self.assertEquals(

            get_anchor_href('Here is a <a href="http://example.com/?blah=1234&something-else=KKdjfkdksa">link</a> to somewhere...'),