This is also failing for me. Replacing `UserBadgesException` with `users.models.UserBadgesException` after `import users` on the top fixes this.

Maybe you want to replace this `try: except` block with the more elegant 
`with self.assertRaises(users.models.UserBadgesException): 
    self.p.fetch_raw_badges()`

Same holds for `try: except` on line 208.