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)
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, "*****@*****.**")
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, "*****@*****.**")
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)
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>")
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)
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)
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>")
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)