예제 #1
0
def profile(request):
    auth_token = get_user_evernote_note(request.user)

    todos = get_todos(auth_token)

    response = 'Done:\n<ul>\n'
    for todo in todos:
        response += '<li>' + todo.item_string + '</li>\n'
    response += '</ul>\n'
    return HttpResponse(response)
예제 #2
0
    def test_get_todos_internal_divs(self, MockEvernoteClient):
        """Test we can handle the <li>s conatining <divs> instead of text"""
        notes = [
            TestNote(1, u'Someone', [u'<div>#todo thing</div>']),
        ]
        self.config_mock_evernoteclient(MockEvernoteClient, notes)

        todos = main.get_todos('mock_auth_token')
        expected_todo = main.ToDo(EvernoteScannerTestCase.note_timestamp,
                                  u'Someone :: #todo thing')
        self.assertEqual(todos, [expected_todo])
예제 #3
0
    def test_get_todos_case_insensitive(self, MockEvernoteClient):
        """Test we can handle upper / lower case"""
        notes = [
            TestNote(1, u'Someone', [u'#ToDo thing']),
        ]
        self.config_mock_evernoteclient(MockEvernoteClient, notes)

        todos = main.get_todos('mock_auth_token')
        expected_todo = main.ToDo(EvernoteScannerTestCase.note_timestamp,
                                  u'Someone :: #ToDo thing')
        self.assertEqual(todos, [expected_todo])
예제 #4
0
    def test_get_todos_unicode_title(self, MockEvernoteClient):
        """Test we can handle unicode note titles"""
        notes = [
            TestNote(1, 'Chunqi', ['Stuff']),
            TestNote(2, u'André', ['#todo thing']),
        ]
        self.config_mock_evernoteclient(MockEvernoteClient, notes)

        todos = main.get_todos('mock_auth_token')
        expected_todo = main.ToDo(EvernoteScannerTestCase.note_timestamp,
                                  u'Andr\xe9 :: #todo thing')
        self.assertEqual(todos, [expected_todo])
예제 #5
0
    def test_get_todos_unicode_content(self, MockEvernoteClient):
        """Test we can handle unicode note content"""
        notes = [
            TestNote(1, 'Chunqi', ['Stuff']),
            TestNote(2, 'Ravi', [u'#todo thé thing']),
            TestNote(3, 'Ren', [u'#todo weird space']),
        ]
        self.config_mock_evernoteclient(MockEvernoteClient, notes)

        todos = main.get_todos('mock_auth_token')
        expected_todos = [ \
            main.ToDo(EvernoteScannerTestCase.note_timestamp, u'Ravi :: #todo thé thing'),\
            main.ToDo(EvernoteScannerTestCase.note_timestamp, u'Ren :: #todo weird space')]
        self.assertEqual(todos, expected_todos)