This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Is there a way for me to mock the fetchNotifications call? | |
| export function fetchNotifications() { | |
| return dispatch => { | |
| dispatch(fetchNotificationsRequest()) | |
| return get('/notifications/self') | |
| .then(json => dispatch(fetchNotificationsSuccess(json))) | |
| .catch(err => dispatch(fetchNotificationsFailure(err))) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { get, post, put } from '../../utils/APIUtils' | |
| export function fetchNotifications() { | |
| return dispatch => { | |
| dispatch(fetchNotificationsRequest()) | |
| // need to mock this get call | |
| return get('/notifications/self') | |
| .then(json => dispatch(fetchNotificationsSuccess(json.body))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from flask.ext.bootstrap import Bootstrap | |
| from flask.ext.mail import Mail | |
| from flask.ext.moment import Moment | |
| from flask.ext.sqlalchemy import SQLAlchemy | |
| from flask.ext.login import LoginManager | |
| from config import config | |
| bootstrap = Bootstrap() | |
| mail = Mail() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| response.data: | |
| '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>Redirecting...</title>\n< | |
| h1>Redirecting...</h1>\n<p>You should be redirected automatically to target URL: <a href="/auth/login">/auth/login</a>. If | |
| not click the link.' | |
| ERROR OCCURS ON LINE 19 OF TEST.PY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error: | |
| /tests/test_register_login.py(41)test_register_and_login() | |
| -> self.assertTrue(response.status_code == 302) | |
| > /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py(424)assertTrue() | |
| -> raise self.failureException(msg) | |
| Test: | |
| def test_register_and_login(self): | |
| # register new account | |
| response = self.client.post(url_for('auth.register'), data={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def edit(id): | |
| post = Post.query.get_or_404(id) | |
| form = PostForm() | |
| if form.validate_on_submit(): | |
| post.body = form.body.data | |
| db.session.add(post) | |
| flash('The post has been updated.') | |
| return redirect(url_for('.post', id=post.id)) | |
| form.body.data = post.body | |
| return render_template('edit_post.html', form=form) |