Here are the examples of the python api django.contrib.auth.get_user_model.objects.create taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
111 Examples
3
Source : test_icatrestauth.py
with Apache License 2.0
from bcgov
with Apache License 2.0
from bcgov
def setUp(self):
self.mock_auth_user = Mock()
self.mock_request = HttpRequest()
self.mock_request.META = self.request_meta
self.mock_auth_user = get_user_model().objects.create(
username=self.mock_username, password=self.mock_password, is_active=True
)
def test_authenticate_no_creds(self):
3
Source : test_views.py
with Apache License 2.0
from bcgov
with Apache License 2.0
from bcgov
def setUp(self):
self.user = get_user_model().objects.create(
username="testuser", password="password"
)
def test_create(self):
3
Source : test_docs.py
with BSD 3-Clause "New" or "Revised" License
from codingjoe
with BSD 3-Clause "New" or "Revised" License
from codingjoe
def test_start__post_with_user(self):
user = get_user_model().objects.create(
email="[email protected]",
first_name="Peter",
last_name="Parker",
username="spidy",
)
response = self.client.post(self.start_url, data=dict(user=user.pk))
self.assertEqual(response.status_code, 302)
workflow = models.WelcomeWorkflow.objects.get()
self.assertTrue(workflow.user)
self.assertTrue(workflow.task_set.succeeded().filter(name="start").exists())
def test_start__post_without_user(self):
3
Source : test_models.py
with BSD 3-Clause "New" or "Revised" License
from codingjoe
with BSD 3-Clause "New" or "Revised" License
from codingjoe
def test_cancel__with_user(self, db):
workflow = workflows.SimpleWorkflow.objects.create()
workflow.task_set.create()
user = get_user_model().objects.create(
email="[email protected]",
first_name="Peter",
last_name="Parker",
username="spidy",
)
workflow.cancel(user=user)
assert workflow.task_set.latest().completed_by_user == user
def test_cancel__with_anonymous_user(self, db):
3
Source : test_models.py
with BSD 3-Clause "New" or "Revised" License
from codingjoe
with BSD 3-Clause "New" or "Revised" License
from codingjoe
def test_cancel__with_user(self, db):
workflow = models.SimpleWorkflowState.objects.create()
workflow.task_set.create()
user = get_user_model().objects.create(
email="[email protected]",
first_name="Peter",
last_name="Parker",
username="spidy",
)
workflow.task_set.cancel(user=user)
assert workflow.task_set.latest().completed_by_user == user
def test_cancel__with_anonymous_user(self, db):
3
Source : test_models.py
with BSD 3-Clause "New" or "Revised" License
from codingjoe
with BSD 3-Clause "New" or "Revised" License
from codingjoe
def test_cancel__with_user(self, db):
workflow = workflows.SimpleWorkflow.objects.create()
task = workflow.task_set.create()
user = get_user_model().objects.create(
email="[email protected]",
first_name="Peter",
last_name="Parker",
username="spidy",
)
task.cancel(user=user)
assert task.completed_by_user == user
def test_cancel__with_anonymous_user(self, db):
3
Source : test_models.py
with MIT License
from dibs-devs
with MIT License
from dibs-devs
def setUp(self):
user_list = []
for i in range(3):
user = get_user_model().objects.create(username=f"user{i}")
user_list.append(user)
room = Room.objects.create()
room.members.add(*user_list)
self.roomlist = Room.objects.all()
def validate_uuid(self, uuid_string):
3
Source : test_models.py
with MIT License
from dibs-devs
with MIT License
from dibs-devs
def setUp(self):
user = get_user_model().objects.create(username="user0")
room = Room()
room.save()
room.members.add(user)
message = Message(room=room, sender=user, text="Notes to myself")
message.save()
def test_message_title(self):
3
Source : test_utils.py
with MIT License
from dibs-devs
with MIT License
from dibs-devs
async def test_no_host_in_headers():
settings.CHANNEL_LAYERS = TEST_CHANNEL_LAYERS
room = Room.objects.create()
user = get_user_model().objects.create(username="user0")
room.members.add(user)
room.save()
client = Client()
client.force_login(user=user)
with pytest.raises(ValueError):
communicator = WebsocketCommunicator(
multitenant_application, f"/ws/django_chatter/chatrooms/{room.id}/",
)
@pytest.mark.asyncio
3
Source : test_views.py
with MIT License
from dibs-devs
with MIT License
from dibs-devs
def setUp(self):
super().setUp()
self.client = TenantClient(self.tenant)
for i in range(5):
user = get_user_model().objects.create(username=f"user{i}")
user.set_password("dummypassword")
user.save()
def test_users_list_view(self):
3
Source : test_views.py
with MIT License
from dibs-devs
with MIT License
from dibs-devs
def setUp(self):
super().setUp()
self.client = TenantClient(self.tenant)
user = get_user_model().objects.create(username="ted")
user.set_password('dummypassword')
user.save()
room = Room.objects.create()
room.members.add(user)
for i in range(25):
Message.objects.create(sender=user, room=room, text=f"Message {i}")
def test_pagination(self):
3
Source : tests.py
with MIT License
from etalab
with MIT License
from etalab
def login_user():
user = get_user_model().objects.create(username="user")
user.set_password("password")
user.save()
client.login(username="user", password="password")
return user
class ModelTest(TestCase):
3
Source : tests.py
with MIT License
from etalab
with MIT License
from etalab
def setUp(self):
self.user = get_user_model().objects.create(username="user")
self.article = Article.objects.create(
name="My First Article", theme="Géographie"
)
self.batch = ParagraphBatch.objects.create()
self.paragraphs = []
for i in range(2, 5):
paragraph = Paragraph.objects.create(
text=f"this is text {i}", article=self.article, batch=self.batch
)
self.paragraphs.append(paragraph)
def test_update_paragraph_also_updates_batch_status(self):
3
Source : test_views.py
with MIT License
from itechub
with MIT License
from itechub
def setUp(self):
self.user_a = get_user_model().objects.create(
username="test_a",
password="password",
email="[email protected]",
is_active=True,
)
self.user_b = get_user_model().objects.create(
username="test_b",
password="password",
email="[email protected]",
is_active=True,
)
self.factory = APIRequestFactory()
# deleting the user will remove the user, and resource CASCADE including file in the disk
def tearDown(self):
3
Source : test_tasks.py
with MIT License
from kiwicom
with MIT License
from kiwicom
def test_notify_users(mocked_api_call):
user = get_user_model().objects.create(
username="unittest", password="unittest", last_name="unittest"
)
solution_user = get_user_model().objects.create(
username="test-assignee", password="test", last_name="test-assignee"
)
outage = Outage(
summary="unittest outage",
created_by=user,
communication_assignee=solution_user,
solution_assignee=user,
eta="3m",
eta_last_modified=arrow.utcnow().shift(hours=-2).datetime,
)
outage.save()
notify_users()
assert mocked_api_call.call_count == 4, "Two users should have been notified"
3
Source : test_utils.py
with MIT License
from kiwicom
with MIT License
from kiwicom
def test_get_absolute_url():
user = get_user_model().objects.create(
username="test", password="test", email="[email protected]"
)
assert utils.format_user_for_slack(user) == "[email protected]"
user.last_name = "test"
assert utils.format_user_for_slack(user) == " < @test>"
@pytest.mark.django_db
3
Source : test_utils.py
with MIT License
from kiwicom
with MIT License
from kiwicom
def test_retrieve_user():
user = get_user_model().objects.create(
username="test", password="test", last_name="test"
)
retrieved_user = utils.retrieve_user(last_name="test")
assert retrieved_user == user
@pytest.mark.django_db
3
Source : utils.py
with MIT License
from kiwicom
with MIT License
from kiwicom
def get_outage(with_solution=False):
user = get_user_model().objects.create(username="unittest", password="unittest")
system = System.objects.create(name="Unittest-system")
outage = Outage(
summary="unittest outage",
created_by=user,
communication_assignee=user,
solution_assignee=user,
sales_affected_choice="Y",
b2b_partners_affected_choice="Y",
sales_affected="test",
systems_affected=system,
resolved=True,
)
outage.save()
if with_solution:
solution = Solution(outage=outage, created_by=user)
solution.save()
return outage
3
Source : tests.py
with MIT License
from Matific
with MIT License
from Matific
def test_select_related_non_parent(self):
user = get_user_model().objects.create(username='artaxerxes')
c = self.ChildClass.objects.get(child_name='Xerxes')
c.user = user
c.save()
with self.assertNumQueries(1):
cc = self.ChildClass.objects.select_related('user').get(child_name='Xerxes')
self.assertEqual(cc.user.username, 'artaxerxes')
def test_delete_qset(self):
3
Source : tests.py
with MIT License
from Matific
with MIT License
from Matific
def setUp(self):
super().setUp()
user = get_user_model().objects.create(username='artaxerxes')
UserChild.objects.create(para_name='A', parb_name='B', parc_name='C', child_name='Xerxes', user=user)
def test_select_related_non_parent(self):
3
Source : tests.py
with MIT License
from Matific
with MIT License
from Matific
def test_select_related_through_parent(self):
user = get_user_model().objects.create(username='artaxerxes')
child = Nephew.objects.create(parfk_user=user)
with self.assertNumQueries(1):
c = Nephew.objects.select_related('parfk_user').get(pk=child.pk)
self.assertEqual(c.parfk_user.username, 'artaxerxes')
def test_select_related_through_parent_with_id(self):
3
Source : tests.py
with MIT License
from Matific
with MIT License
from Matific
def test_select_related_through_parent_with_id(self):
"""
select-related through a parent had a subtle failure: it brought the related object and set
the FK field to it, but it didn't set the related *_id field. Consequently, if the id field
was accessed directly, it was fetched -- and in fact, even threw away the already-fetched
related object. Thus, the assertEqual() line below, which we expected to perform no queries,
actually performed two -- one to get the parfk_user_id field, and then one to get
the parfk_user object.
Now, it sets everything properly
"""
user = get_user_model().objects.create(username='artaxerxes')
child = Nephew.objects.create(parfk_user=user)
with self.assertNumQueries(1):
c = Nephew.objects.select_related('parfk_user').get(pk=child.pk)
self.assertEqual(c.parfk_user_id, c.parfk_user.id)
class VirtualNonParentTestCase(TestCase):
3
Source : test_core.py
with GNU Affero General Public License v3.0
from open-craft
with GNU Affero General Public License v3.0
from open-craft
def setUp(self):
super(PartialUpdateTest, self).setUp()
self.user = get_user_model().objects.create()
self.course_key = CourseKey.from_string('OpenCraft/Onboarding/2018')
self.blocks = [
self.course_key.make_usage_key('course', 'course'),
self.course_key.make_usage_key('chapter', 'course-chapter1'),
self.course_key.make_usage_key('chapter', 'course-chapter2'),
self.course_key.make_usage_key('html', 'course-chapter1-block1'),
self.course_key.make_usage_key('html', 'course-chapter1-block2'),
self.course_key.make_usage_key('html', 'course-chapter2-block1'),
self.course_key.make_usage_key('html', 'course-chapter2-block2'),
]
patch = mock.patch('completion_aggregator.core.compat', StubCompat(self.blocks))
patch.start()
self.addCleanup(patch.stop)
@XBlock.register_temp_plugin(CourseBlock, 'course')
3
Source : test_core.py
with GNU Affero General Public License v3.0
from open-craft
with GNU Affero General Public License v3.0
from open-craft
def setUp(self):
super(TaskArgumentHandlingTestCase, self).setUp()
self.user = get_user_model().objects.create(username='sandystudent')
self.course_key = CourseKey.from_string('course-v1:OpenCraft+Onboarding+2018')
self.block_keys = {
self.course_key.make_usage_key('html', 'course-chapter-html0'),
self.course_key.make_usage_key('html', 'course-chapter-html1'),
}
@mock.patch('completion_aggregator.core.update_aggregators')
3
Source : test_signals.py
with GNU Affero General Public License v3.0
from open-craft
with GNU Affero General Public License v3.0
from open-craft
def test_cohort_signal_handler(self):
course_key = CourseKey.from_string('course-v1:edX+test+2018')
user = get_user_model().objects.create(username='deleter')
with patch('completion_aggregator.core.compat', StubCompat([])):
cohort_updated_handler(user, course_key)
assert StaleCompletion.objects.filter(username=user.username, course_key=course_key, force=True).exists()
3
Source : test_models.py
with GNU General Public License v3.0
from openwisp
with GNU General Public License v3.0
from openwisp
def test_auto_username(self):
org = self.default_org
u = get_user_model().objects.create(
username='test', email='[email protected]', password='test'
)
self._create_org_user(organization=org, user=u)
c = self._create_radius_check(
user=u,
op=':=',
attribute='Max-Daily-Session',
value='3600',
organization=org,
)
self.assertEqual(c.username, u.username)
def test_empty_username(self):
3
Source : test_models.py
with GNU General Public License v3.0
from openwisp
with GNU General Public License v3.0
from openwisp
def test_auto_username(self):
org = self.default_org
u = get_user_model().objects.create(
username='test', email='[email protected]', password='test'
)
self._create_org_user(organization=org, user=u)
r = self._create_radius_reply(
user=u,
attribute='Reply-Message',
op=':=',
value='Login failed',
organization=org,
)
self.assertEqual(r.username, u.username)
def test_empty_username(self):
3
Source : test_models.py
with GNU General Public License v3.0
from openwisp
with GNU General Public License v3.0
from openwisp
def test_usergroups_auto_fields(self):
g = self._create_radius_group(name='test', description='test')
u = get_user_model().objects.create(
username='test', email='[email protected]', password='test'
)
ug = self._create_radius_usergroup(user=u, group=g, priority=1)
self.assertEqual(ug.groupname, g.name)
self.assertEqual(ug.username, u.username)
def test_usergroups_empty_groupname(self):
3
Source : test_models.py
with GNU General Public License v3.0
from openwisp
with GNU General Public License v3.0
from openwisp
def test_usergroups_empty_groupname(self):
u = get_user_model().objects.create(
username='test', email='[email protected]', password='test'
)
try:
self._create_radius_usergroup(user=u, priority=1)
except ValidationError as e:
self.assertIn('groupname', e.message_dict)
self.assertIn('group', e.message_dict)
else:
self.fail('ValidationError not raised')
def test_usergroups_empty_username(self):
3
Source : test_models.py
with GNU General Public License v3.0
from openwisp
with GNU General Public License v3.0
from openwisp
def test_change_user_username(self):
g = self._create_radius_group(name='test', description='test')
u = get_user_model().objects.create(
username='test', email='[email protected]', password='test'
)
ug = self._create_radius_usergroup(user=u, group=g, priority=1)
u.username = 'changed'
u.full_clean()
u.save()
ug.refresh_from_db()
# ensure related records have been updated
self.assertEqual(ug.username, u.username)
def test_delete(self):
3
Source : base.py
with MIT License
from oscarychen
with MIT License
from oscarychen
def setup_user_customer():
user = get_user_model().objects.create(username="tester", email="[email protected]", password="12345")
stripe_user = StripeUser.objects.create(user_id=user.id, customer_id="cus_tester")
return user, stripe_user
@staticmethod
3
Source : test_presentation.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
self.set_proposal_period()
def set_proposal_period(self):
3
Source : test_review.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
self.category = Category.objects.get(pk=1)
self.category2 = Category.objects.get(pk=2)
self.difficulty = Difficulty.objects.get(pk=1)
self.set_openreview_period()
def set_openreview_period(self):
3
Source : test_review.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def create_presentations(self, n, category, difficulty):
presentations = []
for i in range(n):
username = f'user_{i}_{category.id}_{difficulty.id}'
user = get_user_model().objects.create(
username=username,
email=f'{username}@pycon.kr')
presentations.append(Presentation.objects.create(
name=f'presentation_{i}',
owner=user,
background_desc=f'background_{i}',
duration=Presentation.DURATION_LONG,
detail_desc=f'detail_desc_{i}',
category=category,
difficulty=difficulty,
submitted=True,
accepted=True))
return presentations
3
Source : test_sponsor.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
self.factory = RequestFactory()
def test_후원사_등록_이력이_없을_때에는_None_반환(self):
3
Source : test_sprint.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
def test_get_sprints(self):
3
Source : test_tutorial.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
def test_get_tutorials(self):
3
Source : test_ticket.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
self.earlybird_product = self.create_conference_product(name='얼리버드 티켓')
self.deposit_conference_product = self.create_deposit_conference_product(name='단체 현금 구매 티켓')
self.regular_product = self.create_conference_product(name='일반 티켓')
start_at_1 = now() + timedelta(days=14)
start_at_2 = now() + timedelta(days=15)
self.youngcoder_product_1 = self.create_youngcoder_product(name='영코더1', start_at=start_at_1)
self.youngcoder_product_2 = self.create_youngcoder_product(name='영코더2', start_at=start_at_2)
self.childcare_product_1 = self.create_childcare_product(name='아이돌봄1', start_at=start_at_1)
self.childcare_product_2 = self.create_childcare_product(name='아이돌봄2', start_at=start_at_2)
self.sprint_product = self.create_sprint_product(name='스프린트')
def create_conference_product(self, name='얼리버드 티켓'):
3
Source : test_ticket.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def test_WHEN_다른_유저의_티켓이력_출력_실패(self):
product = self.create_youngcoder_product()
other_user = get_user_model().objects.create(
username='test_user_name',
email='[email protected]')
ticket = Ticket.objects.create(
product=product, owner=other_user, status=TransactionMixin.STATUS_PAID)
variables = {'globalId': to_global_id(TicketNode._meta.name, ticket.pk)}
result = self.client.execute(TICKET, variables=variables)
data = result.data
self.assertIsNone(data['ticket'])
@mock.patch('ticket.schemas.config')
3
Source : test_ticket.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def test_cancel_ticket_다른_유저의_티켓(self, mock_iamport, mock_config):
self.mock_config_and_iamporter(mock_config, mock_iamport)
product = self.create_conference_product()
another_user = get_user_model().objects.create(
username='another',
email='[email protected]')
ticket = Ticket.objects.create(
product=product, owner=another_user, status=TransactionMixin.STATUS_PAID,
imp_uid='imp_testtest')
variables = {
"ticketId": to_global_id(TicketNode._meta.name, ticket.pk),
}
result = self.client.execute(CANCEL_TICKET, variables)
self.assertIsNotNone(result.errors)
@mock.patch('ticket.schemas.config')
3
Source : test_ticket_product.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def setUp(self):
self.user = get_user_model().objects.create(
username='develop_github_123',
email='[email protected]')
self.client.authenticate(self.user)
def create_ticket_product(self, product_type, owner=None, name='티켓', price=50000, total=3, is_unique_in_type=False):
3
Source : test_ticket_product.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def test_WHEN_다른_유저가_티켓을_구매했으면_get_ticket_products_THEN_영향_안미침(self):
product = self.create_ticket_product(
name='얼리버드 티켓', product_type=TicketProduct.TYPE_CONFERENCE)
user = get_user_model().objects.create(
username='other_user',
email='[email protected]')
Ticket.objects.create(
product=product, owner=user, status=TransactionMixin.STATUS_PAID)
result = self.client.execute(TICKET_PRODUCTS)
data = result.data
self.assertEqual(0, data['conferenceProducts'][0]['purchaseCount'])
self.assertEqual(False, data['conferenceProducts'][0]['isPurchased'])
def test_WHEN_매진이면_get_ticket_products_THEN_매진이라고_반환(self):
3
Source : test_ticket_product.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def test_WHEN_매진이면_get_ticket_products_THEN_매진이라고_반환(self):
product = self.create_ticket_product(
name='얼리버드 티켓', product_type=TicketProduct.TYPE_CONFERENCE, total=1)
user = get_user_model().objects.create(
username='other_user',
email='[email protected]')
Ticket.objects.create(
product=product, owner=user, status=TransactionMixin.STATUS_PAID)
result = self.client.execute(TICKET_PRODUCTS)
data = result.data
self.assertTrue(data['conferenceProducts'][0]['isSoldOut'])
self.assertEqual(0, data['conferenceProducts'][0]['remainingCount'])
def test_WHEN_팔리기전에는_get_ticket_products_THEN_total과_remaining_count_가_같음(self):
3
Source : test_ticket_product.py
with Apache License 2.0
from pythonkr
with Apache License 2.0
from pythonkr
def test_get_ticket_products_with_ticket_for_호출하는_사용자가_ticket_for에_없을_때(self):
product = self.create_ticket_product(
name='얼리버드 티켓', product_type=TicketProduct.TYPE_CONFERENCE)
user = get_user_model().objects.create(
username='other_user',
email='[email protected]')
product.ticket_for.add(user)
result = self.client.execute(TICKET_PRODUCTS)
data = result.data
self.assertEqual(0, len(data['conferenceProducts']))
3
Source : util.py
with MIT License
from RTIInternational
with MIT License
from RTIInternational
def create_profile(username, password, email):
"""Create a user with the given attributes.
Create a user in Django's authentication model and link it to our own project user
model.
"""
user = get_user_model().objects.create(
username=username, password=password, email=email
)
return Profile.objects.get(user=user)
def create_project(name, creator, percentage_irr=10, num_users_irr=2, classifier=None):
3
Source : tests.py
with MIT License
from serioeseGmbH
with MIT License
from serioeseGmbH
def setUp(self):
self.authorized_user = get_user_model().objects.create(
username='authorized_user'
)
self.unauthorized_user = get_user_model().objects.create(
username='unauthorized_user'
)
create_permissions.Command().handle()
create_groups.Command().handle()
self.authorized_user.groups.add(AuthorizedGroup)
self.factory = RequestFactory()
def test_authorized_user_has_permission(self):
3
Source : tests.py
with MIT License
from serioeseGmbH
with MIT License
from serioeseGmbH
def setUpTestData(cls):
create_permissions.Command().handle()
cls.authorized_user = get_user_model().objects.create(
username='authorized_user'
)
perm = GlobalPermission.get()
cls.authorized_user.user_permissions.add(perm)
cls.unauthorized_user = get_user_model().objects.create(
username='unauthorized_user'
)
cls.factory = RequestFactory()
def test_unauthorized_user_does_not_have_permission(self):
3
Source : tests.py
with MIT License
from serioeseGmbH
with MIT License
from serioeseGmbH
def setUp(self):
create_permissions.Command().handle()
self.authorized_user = get_user_model().objects.create(
username='authorized_user'
)
RestrictedModelPermission.get() # create the permission in the DB
def test_object_based_permissions_work_as_intended(self):
3
Source : tests.py
with GNU Affero General Public License v3.0
from svthalia
with GNU Affero General Public License v3.0
from svthalia
def test_nonmember_user(self):
u = get_user_model().objects.create(username="foo")
self.assertEqual(set(), u.get_all_permissions())
class CommitteeMailingListTest(TestCase):
3
Source : conftest.py
with MIT License
from techlib
with MIT License
from techlib
def valid_identity():
id_string = '[email protected]'
user = get_user_model().objects.create(username='test')
Identity.objects.create(user=user, identity=id_string)
yield id_string
@pytest.fixture
See More Examples