kylewm / redwind

Flask-based personal website #IndieWeb #OwnYourData
Other
45 stars 5 forks source link

Tagcloud #17

Closed thedod closed 9 years ago

thedod commented 9 years ago

I think it's OK now. Something got mixed up in the diff view. Same pull request as before :wink:

kylewm commented 9 years ago

This looks really cool! I added a couple of notes inline. Thanks :+1:

kylewm commented 9 years ago

Thanks for the updates! Is there any chance you would be up for adding a unit test to https://github.com/kylewm/redwind/blob/master/tests/views_test.py ?

I haven't been good about them until now, but the project has gotten large enough that I can't refactor without them...at least not without breaking absolutely everything.

thedod commented 9 years ago

OK. I'll try to write something

thedod commented 9 years ago

passed the test, but I was "cheating" :smiling_imp:: Tag cloud counts a hidden post (firefly), and IIUC — it shouldn't.

kylewm commented 9 years ago

Actually, hidden = True just hides it from the front page stream; it's still part of everything (likes and bookmarks are "hidden" by default). Post.hidden shouldn't (IMO) be in the SQL statement at all.

That doesn't of course explain why it's not behaving as coded... Not sure.

thedod commented 9 years ago

Also 167 isn't covered.

I think we should have a draft post in the sillies, then logout and have tests that make sure it doesn't appear at /,/tag,/tag/sometag

kylewm commented 9 years ago

Good point. I don't use drafts much yet (mostly because I don't have a way to update the published date when it goes from draft -> published, which is annoying) so it has been a little lower priority.

thedod commented 9 years ago

I don't have a way to update the published date when it goes from draft -> published

I'm not sure I understood that (and I'd like to, because I'm thinking of doing the "post-state-aware GUI" thing).

Regardless of drafts, there's one-time setup of doing a suite of tests while logged out. This could probably increase coverage significantly.

kylewm commented 9 years ago

See https://github.com/kylewm/redwind/issues/18 for more discussion of drafts.

And I agree that tests should ideally check both logged in and logged out cases. It's not quite as simple as just running the tests while logged out, since they all have to be logged in initially to create the posts.

kylewm commented 9 years ago

And I'm ready to merge this as soon as Post.hidden is removed from the SQL. Thanks!