aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/models
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-04-24 19:05:14 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-05-15 00:22:08 +0200
commit804d6fc6b9268577dbfd85f169f1a3f58e5cd6bc (patch)
treee6926a2734cc48d9160071c7238bf25ed0c6e108 /pyaggr3g470r/models
parentcorrecting log level for error in feed retrieving (diff)
downloadnewspipe-804d6fc6b9268577dbfd85f169f1a3f58e5cd6bc.tar.gz
newspipe-804d6fc6b9268577dbfd85f169f1a3f58e5cd6bc.tar.bz2
newspipe-804d6fc6b9268577dbfd85f169f1a3f58e5cd6bc.zip
adding base unittests
Diffstat (limited to 'pyaggr3g470r/models')
-rw-r--r--pyaggr3g470r/models/__init__.py3
-rw-r--r--pyaggr3g470r/models/article.py10
2 files changed, 7 insertions, 6 deletions
diff --git a/pyaggr3g470r/models/__init__.py b/pyaggr3g470r/models/__init__.py
index 42903f4e..ba52b0de 100644
--- a/pyaggr3g470r/models/__init__.py
+++ b/pyaggr3g470r/models/__init__.py
@@ -98,4 +98,5 @@ def db_create(db):
user1.roles.extend([role_admin, role_user])
db.session.add(user1)
- db.session.commit() \ No newline at end of file
+ db.session.commit()
+ return role_admin, role_user
diff --git a/pyaggr3g470r/models/article.py b/pyaggr3g470r/models/article.py
index 58cd0384..3151071a 100644
--- a/pyaggr3g470r/models/article.py
+++ b/pyaggr3g470r/models/article.py
@@ -66,14 +66,14 @@ class Article(db.Model):
.order_by(asc("Article.date")).first()
def __repr__(self):
- return json.dumps({
- "title": self.title,
- "link": self.link,
- "content": self.content
- })
+ return json.dumps({"title": self.title,
+ "link": self.link,
+ "content": self.content
+ })
def dump(self):
return {"id": self.id,
+ "user_id": self.user_id,
"title": self.title,
"link": self.link,
"content": self.content,
bgstack15