def handle(self, *args, **options): # # Create superuser # broak = User() broak.name = 'Broak' broak.email = '*****@*****.**' broak.username = '******' broak.is_active = True broak.is_staff = True broak.is_superuser = True broak.set_password('abc123') broak.save() self.user_msg(broak) # # Create memes # meme = Meme() meme.name = 'Bachelor Frog' meme.code = 'bachelor-frog' meme.owner = broak meme.save() self.meme_msg(meme) meme = Meme() meme.name = 'Insanity Wolf' meme.code = 'insanity-wolf' meme.owner = broak meme.save() self.meme_msg(meme) meme = Meme() meme.name = 'Philosoraptor' meme.code = 'Philosoraptor' meme.owner = broak meme.save() self.meme_msg(meme)
def test_user_email_user(self): try: u = User() u.name = 'Batman' u.username = '******' u.email = '*****@*****.**' u.set_password('abc123') u.is_superuser = True u.is_active = True u.is_staff = True u.save() u.email_user('Hello', 'World', from_email='*****@*****.**') is_valid = True except Exception: is_valid = False self.assertTrue(is_valid)