Example #1
0
    def test_create_note_valid(self):
        note = Note.create(email='*****@*****.**')
        self.assertEqual("<p>This is the text of my note.</p>", note.html)

        # check params
        note = Note.create(email='*****@*****.**', body="home")
        self.assertEqual("<p>This is the text of my note.</p>", note.html)
Example #2
0
    def test_create_note_valid(self):
        note = Note.create(email='*****@*****.**')
        self.assertEqual("<p>This is the text of my note.</p>", note.html)

        # check params
        note = Note.create(email='*****@*****.**', body="home")
        self.assertEqual("<p>This is the text of my note.</p>", note.html)
Example #3
0
def test_note():
    httpretty.register_uri(
        post, r(r"/v1/users/notes"),
        body=fixture('v1-users-note'))
    note = Note.create(body="This is a note", email='*****@*****.**')
    eq_(note.html, "<p>This is a note</p>")
    eq_(note.user.email, "*****@*****.**")
Example #4
0
def test_note():
    httpretty.register_uri(post,
                           r(r"/v1/users/notes"),
                           body=fixture('v1-users-note'))
    note = Note.create(body="This is a note", email='*****@*****.**')
    eq_(note.html, "<p>This is a note</p>")
    eq_(note.user.email, "*****@*****.**")
Example #5
0
 def test_find_note(self):
     # Find a note by id
     orig_note = Note.create(
         body="<p>Text for the note</p>",
         email=self.email)
     note = Note.find(id=orig_note.id)
     self.assertEqual(note.body, orig_note.body)
Example #6
0
 def it_creates_a_note(self):
     data = {
         'body': '<p>Note to leave on user</p>',
         'created_at': 1234567890
     }
     with patch.object(Intercom, 'post', return_value=data) as mock_method:
         note = Note.create(body="Note to leave on user")
         mock_method.assert_called_once_with(
             '/notes/', body="Note to leave on user")  # noqa
         eq_(note.body, "<p>Note to leave on user</p>")
Example #7
0
 def test_find_note(self):
     # Find a note by id
     orig_note = Note.create(body="<p>Text for the note</p>",
                             email=self.email)
     note = Note.find(id=orig_note.id)
     self.assertEqual(note.body, orig_note.body)
Example #8
0
 def test_create_note(self):
     # Create a note for a user
     note = Note.create(body="<p>Text for the note</p>", email=self.email)
     self.assertIsNotNone(note.id)
Example #9
0
 def test_create_note_identifiers(self):
     Note.create()
 def it_creates_a_note(self):
     data = {"body": "<p>Note to leave on user</p>", "created_at": 1234567890}
     with patch.object(Intercom, "post", return_value=data) as mock_method:
         note = Note.create(body="Note to leave on user")
         mock_method.assert_called_once_with("/notes/", body="Note to leave on user")  # noqa
         eq_(note.body, "<p>Note to leave on user</p>")
Example #11
0
 def test_create_note_identifiers(self):
     Note.create()
Example #12
0
 def test_create_note(self):
     # Create a note for a user
     note = Note.create(
         body="<p>Text for the note</p>",
         email=self.email)
     self.assertIsNotNone(note.id)