
import factory

from django.contrib.auth.models import User


class UserFactory(factory.Factory):
    FACTORY_FOR = User

    first_name = "Boy"
    last_name = "Factory"
    email = factory.LazyAttribute(
        lambda a:
        "{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
    username = factory.Sequence(lambda n: "username_%s" % n)


import factory

from django.contrib.auth.models import User


class UserFactory(factory.Factory):
    FACTORY_FOR = User

    first_name = "Boy"
    last_name = "Factory"
    email = factory.LazyAttribute(
        lambda a:
        "{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
    username = factory.Sequence(lambda n: "username_%s" % n)
    is_active = False
    is_staff = False
    is_superuser = False

Fix userfactory - set user flags
Fix userfactory - set user flags

  
  import factory
  
  from django.contrib.auth.models import User
  
  
  class UserFactory(factory.Factory):
      FACTORY_FOR = User
  
      first_name = "Boy"
      last_name = "Factory"
      email = factory.LazyAttribute(
          lambda a:
          "{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
      username = factory.Sequence(lambda n: "username_%s" % n)
+     is_active = False
+     is_staff = False
+     is_superuser = False
  
Fix userfactory - set user flags
## Code Before:

import factory

from django.contrib.auth.models import User


class UserFactory(factory.Factory):
    FACTORY_FOR = User

    first_name = "Boy"
    last_name = "Factory"
    email = factory.LazyAttribute(
        lambda a:
        "{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
    username = factory.Sequence(lambda n: "username_%s" % n)

## Instruction:
Fix userfactory - set user flags
## Code After:

import factory

from django.contrib.auth.models import User


class UserFactory(factory.Factory):
    FACTORY_FOR = User

    first_name = "Boy"
    last_name = "Factory"
    email = factory.LazyAttribute(
        lambda a:
        "{0}_{1}@example.com".format(a.first_name, a.last_name).lower())
    username = factory.Sequence(lambda n: "username_%s" % n)
    is_active = False
    is_staff = False
    is_superuser = False
